Morning all,
I have a question about using the %ENV hash. I have a script I wrote that runs as a cron job. While the script runs fine from the command line, it does not as a cron because it does not have all the correct shell ENV variables, in this case $ORACLE_HOME and $ORACLE_SID. What I have done in the past is create a shell script wrapper that runs my script as in:
While this works, I would like to not have to create my wrapper and do it all in my script. I know I can get the variable in my script with:
my $ORACLE_HOME = $ENV{ORACLE_HOME};
Is that all I need to do? If so (or if not for that matter), how does the shell my script runs under get this var?
Thanks,
Nick
I have a question about using the %ENV hash. I have a script I wrote that runs as a cron job. While the script runs fine from the command line, it does not as a cron because it does not have all the correct shell ENV variables, in this case $ORACLE_HOME and $ORACLE_SID. What I have done in the past is create a shell script wrapper that runs my script as in:
Code:
export ORACLE_SID = mysid
export ORACLE_HOME = opt/my/oracle
# Then run my script
/local/bin/my_perl_script.pl
While this works, I would like to not have to create my wrapper and do it all in my script. I know I can get the variable in my script with:
my $ORACLE_HOME = $ENV{ORACLE_HOME};
Is that all I need to do? If so (or if not for that matter), how does the shell my script runs under get this var?
Thanks,
Nick