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;

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros