Following is the output of .profile file -
$ cat /home/estdm2/.profile
#!/bin/ksh
set -o vi
alias l="ls -ltr"
umask 002
Following is the path setting script.
$ cat DM_ENV_VARS_NEW.ksh
#!/bin/ksh
. /home/estdm2/.profile
sEnv=$1
echo "We are in ${sEnv} environment"
echo "STEP010 - Set Environment Variables for script."
export DM_ETL_HOME=/etl/estdm2
export SCRIPT_DIR=${DM_ETL_HOME}/scripts
export BASE_LOG_DIR=${DM_ETL_HOME}/log
export LOG_DIR=${BASE_LOG_DIR}/script
When I call DM_ENV_VARS_NEW.ksh script from another script and print the variable, it prints nothing. So the export is not working properly
$ cat /etl/estdm2/dev/scripts/test.ksh
#!/bin/ksh
#
echo "Testing the script - DM_ENV_VARS.ksh"
/etl/estdm2/dev/scripts/DM_ENV_VARS_NEW.ksh DEV
echo ${DM_ETL_HOME}
echo $BASE_LOG_DIR
$ /etl/estdm2/dev/scripts/test.ksh
Testing the script - DM_ENV_VARS.ksh
We are in DEV environment
STEP010 - Set Environment Variables for script.
I dont know what's going wrong with such a simple script.
I would appreciate any suggestion.
Thanks
Sumeet