I am facing a very strange issue. I have script in ksh with #!/bin/ksh as shebang.
This script has function which sets the env variable before running other functions of the script. by
set_up_env()
{
CONFIG_FILE="/opt/app/tools/deepmarking/latestVersion/script/UploadEnv"
if [ -f ${CONFIG_FILE} ]
then
#Source the environment
. ${CONFIG_FILE}
else
err_exit "ERROR: Config file doesnot exist"
fi
}
And the shell I am running this script is csh. But for some unknown reason, the env variable declared on the config file are not getting set properly and hence the purpose of the script is not achieved.
Sample Error:
: not foundksh: /opt/app/tools/deepmarking/latestVersion/script/UploadEnv[8]:
: not foundksh: /opt/app/tools/deepmarking/latestVersion/script/UploadEnv[29]:
: not foundksh: /opt/app/tools/deepmarking/latestVersion/script/UploadEnv[31]:
: not foundksh: /opt/app/tools/deepmarking/latestVersion/script/UploadEnv[35]:
But if i declare all these variables present on UploadEnv in the same script at the start. This works with out any issues.