troubleshooting Question

Passing variables into Korn Shell or setting up variable - HELP!!!

Avatar of elwayisgod
elwayisgodFlag for United States of America asked on
System Programming
4 Comments1 Solution650 ViewsLast Modified:
I need to set up some Environment Variables in ksh.  Note I'm on Windows using MKS Toolkit.   I have a file named 'setenv.ksh' that is:

hyp_home_drive=F:
hyp_batch_path=\Hyperion\batch
essUserID=admin
esspassword=password
essserver=sdndheb2

ess_bin_source=F:\Hyperion\Essbase\bin
ess_bin_bkup=F:\EssbaseBackup\Daily\EssbaseFiles
ess_bkup_daily=F:\EssbaseBackup\Daily
ess_bkup_daily_ksh=F:/EssbaseBackup/Daily
ess_bkup_logs=F:\EssbaseBackupLogs
ess_bkup_logs_ksh=F:/EssbaseBackupLogs
ess_log_source=F:\Hyperion\Essbase
ess_log_bkup=F:\EssbaseBackup\Daily\EssbaseFiles
ess_ssaudit_source=F:\EssbaseBackup\SSAUDIT
ess_ssaudit_bkup=F:\EssbaseBackup\Daily\SSAUDIT
ess_app_dir_source=F:\Hyperion\essbase\app
ess_app_dir_source_ksh=F:/Hyperion/essbase/app
ess_app_dir_bkup=F:\EssbaseBackup\Daily\App
ess_scripts_bkup=F:\Hyperion\essbase\scripts\maxl
ess_bkup_dir=F:/EssbaseBackup

Then in my .bat file, I'm trying to call it so it sets these variable for the ksh peices of my code.  However it does not set these variables.  I need the last lines to call the setenv.ksh file and set the variable for the rest of the script.  Here is my .bat file.

echo. |time > DailyBackupStartTime

REM Set the Environment Variables for this script
REM DO NOT SETENV.CMD with variables for the below. Keep it hardcoded F:\Hyperion\essbase\scripts\maxl\setenv.cmd
       
        call F:\Hyperion\essbase\scripts\maxl\setenv.cmd


REM Step 1 Logout all users, shutdown service, and delete current contents of folders
     
    erase %ess_bkup_logs%\*.* /S/Q/F
    REM > %ess_bkup_logs%\Step_1A.txt (All the files overwrite existing, thus no need for this line)
   
REM Delete the 'App' directory in backup location as it will be refreshed in Step_6 below

      rmdir %ess_app_dir_bkup%\"."/S/Q >> %ess_bkup_logs%\Step_1A.txt
     
REM Set the Environment Variables for the Korn Shell

      cd %ess_app_dir_source%\
      ksh.exe ./setenv.ksh
     

**********************************************

Note:  The 'call' statement sets the same variable in the windows batch scripting portion and is working properly.  thus the issue, I need the ksh part to set them too for that part.

Then when I run it, it's passing the wrong password '3ssb@s3' and server 'sdntheb2'.  Instead of 'password' and 'sdndheb2'.  I have no idea how the wrong variable is getting passed into here or where it came from.

MAX> login admin 3ssb@s3 on sdntheb2;

ASKER CERTIFIED SOLUTION
yuzh

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Log in to continue reading
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform for $9.99/mo
View membership options
Unlock 1 Answer and 4 Comments.
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
The Value of Experts Exchange in My Daily IT Life

Experts Exchange (EE) has become my company's go-to resource to get answers. I've used EE to make decisions, solve problems and even save customers. OutagesIO has been a challenging project and... Keep reading >>

Mike

Owner of Outages.IO
Phoenix, Arizona, United States
Member Since 2016
Join a full scale community that combines the best parts of other tools into one platform.
Unlock 1 Answer and 4 Comments.
View membership options
“All of life is about relationships, and EE has made a virtual community a real community. It lifts everyone's boat.”
William Peck

Member since 2004