in reply to Re^2: how to set environmental vars
in thread how to set environment vars
While we're at fixing each other's code:
You forgot about the issue of an executable being in $PATH and being executed instead of the shell we are after.| | exec '/bin/csh', '-c', "source env.csh ; perl $0 nested"; | |
As far as an infinite loop is concerned I did state that I am testing for a variable that I know exists and is set in the env.csh file.
Fixing the last two bullet items you are referring to is not covered in fix either AFAICT. Any arguments being passed to the script are going to be lost. To fix that I'd add
exec '/bin/csh', '-c', sprintf("source env.csh ; perl $0 nested %s" +,join(" ",@ARGV));
And believe it or not there are still some ways to break this...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: how to set environmental vars
by ikegami (Patriarch) on Nov 11, 2005 at 03:41 UTC | |
Re^4: how to set environmental vars
by rsennat (Beadle) on Nov 11, 2005 at 09:54 UTC |