Ronnie has asked for the wisdom of the Perl Monks concerning the following question:
In most users this works but our production user - interface - didn't have the SECTRAN_DIR environment variable set, after correcting this any script calling sectran works. But only at the command line. When trying to run scripts via the interface cron they fail as the SECTRAN_DIR variable is not being found. Initially I thought this was the old chestnut about the interface cron not calling the local .profile so I included said call in my script.use lib "$ENV{'SECTRAN_DIR'}/lib" ; use sectran ;
This prints out the .profile file that it has executed -if (exists $ENV{HOME}) { $file = "$ENV{HOME}/.profile" ; if (! -x $file) { print "\n\tUnable to execute the $file from the current user!\n" +; print "\n\tInsufficient permissions!\n" ; $result = 99 ; } else { open INP,"<$file" or die "\n\tfitz yer gem min?" ; while (<INP>) { print $_ } close INP or die "\n\tA canny dee it min!\n" ; # print "\n\tRunning $file.\n" ; $result = system "$file" ; print "\n\tResult set to $result\n" ; } # } else { print "\n\tNo profile file found!\n" ; $result = 98 ; }
Bear with me as we are getting to the crux of the problem now.This made no difference - SECTRAN_DIR still did not exist. I then added code to print out the ENV hash which I foolishly thought should reflect the .profile listed -TERM=vt220; export TERM PATH=/usr/local/bin:/usr/bin:/usr/ucb:/etc:/isw/tpp/oracle/live/1.6.1/ +ids/bin:/i sw/tpp/oracle/live/1.6.1/ids/forms60/mesg:/isw/appwork/live/finance/gu +ifmxs:. EDITOR=vi ;export EDITOR umask 002 ORACLE_TERM=vt220 ; export ORACLE_TERM ORACLE_SID=ISWLIVE ; export ORACLE_SID ORACLE_HOME=/isw/tpp/oracle/live/8.1.7; export ORACLE_HOME PATH=$PATH:${ORACLE_HOME}/bin:${ORACLE_HOME}/dbs export PATH LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/usr/lib:/usr/ucblib export LD_LIBRARY_PATH PS1='${ORACLE_SID} > ' PS2='?' SECTRAN_DIR=/home/interface/sectran export SECTRAN_DIR TWO_TASK=isw-live; # Addition to allow ORACLE Forms testing in TEST & Other environments +- Bob alias ISWTEST='ORACLE_SID=ISWTEST ; export ORACLE_SID; \ ORACLE_HOME=/isw/tpp/oracle/test/8.1.7; export ORACLE_HOME \ LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/ucblib export LD_LIBRARY_PATH PATH=/usr/local/bin:/usr/bin:/usr/ucb:/etc:/isw/tpp/oracle/test/1.6.1/ +idst/bin:/ isw/tpp/oracle/test/1.6.1/idst/forms60/mesg:/isw/appwork/test/finance/ +guifmxs:. PATH=$PATH:${ORACLE_HOME}/bin:${ORACLE_HOME}/dbs export PATH' # ISWLIVE alias ISWLIVE='ORACLE_SID=ISWLIVE ; export ORACLE_SID; \ ORACLE_SID=ISWLIVE ; export ORACLE_SID ORACLE_HOME=/isw/tpp/oracle/live/8.1.7; export ORACLE_HOME LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/usr/lib:/usr/ucblib export LD_LIBRARY_PATH PATH=/usr/local/bin:/usr/bin:/usr/ucb:/etc:/isw/tpp/oracle/live/1.6.1/ +ids/bin:/i sw/tpp/oracle/live/1.6.1/ids/forms60/mesg:/isw/appwork/live/finance/gu +ifmxs:. PATH=$PATH:${ORACLE_HOME}/bin:${ORACLE_HOME}/dbs export PATH' # ISWTEACH alias ISWTEACH='ORACLE_SID=ISWTEACH ; export ORACLE_SID; \ ORACLE_SID=ISWTEACH ; export ORACLE_SID ORACLE_HOME=/isw/tpp/oracle/general/8.1.7; export ORACLE_HOME LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/usr/lib:/usr/ucblib export LD_LIBRARY_PATH PATH=/usr/local/bin:/usr/bin:/usr/ucb:/etc:/isw/tpp/oracle/general/1.6 +.1/ids/bin :/isw/tpp/oracle/general/1.6.1/ids/forms60/mesg:/isw/appwork/general/f +inance/gui fmxs:. PATH=$PATH:${ORACLE_HOME}/bin:${ORACLE_HOME}/dbs export PATH'
Imagine my surprise then when the following was output -# while (($key, $value) = each (%ENV)) { print "\n\tKey :: $key" ; print "\n\tValue :: $value" ; }
Does anyone understand this? I can find no trace of any .profile to reflect the results in the ENV hash table! Cheers, RonnieRunning /home/interface/.profile. Result set to 0 Key :: HOME Value :: /home/interface Key :: LOGNAME Value :: interface Key :: SHELL Value :: /usr/bin/sh Key :: TZ Value :: GB Key :: PATH Value :: /usr/bin:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl/UNIX .profile problem
by Corion (Patriarch) on Nov 18, 2004 at 10:24 UTC | |
by Ronnie (Scribe) on Nov 18, 2004 at 10:45 UTC | |
by Happy-the-monk (Canon) on Nov 18, 2004 at 11:24 UTC | |
Re: Perl/UNIX .profile problem
by insensate (Hermit) on Nov 18, 2004 at 16:04 UTC | |
Re: Perl/UNIX .profile problem
by Zaxo (Archbishop) on Nov 18, 2004 at 14:00 UTC | |
by marcelo.magallon (Acolyte) on Nov 18, 2004 at 16:46 UTC | |
by elwarren (Priest) on Nov 18, 2004 at 18:06 UTC | |
Re: Perl/UNIX .profile problem
by mce (Curate) on Nov 18, 2004 at 12:29 UTC | |
Re: Perl/UNIX .profile problem
by elwarren (Priest) on Nov 18, 2004 at 18:04 UTC | |
Re: Perl/UNIX .profile problem
by meredith (Friar) on Nov 19, 2004 at 02:52 UTC | |
Re: Perl/UNIX .profile problem
by graff (Chancellor) on Nov 19, 2004 at 03:29 UTC | |
Re: Perl/UNIX .profile problem
by pelagic (Priest) on Nov 19, 2004 at 09:06 UTC |