in reply to RE: RE: chdir vs. shell behavior
in thread chdir vs. shell behavior
As someone else pointed out, passing the output from the script to a cd command works too. But things complicate if you want to change more of the environment than just the directory...
That is (shell script):
And in the perl script:# ... stuff run every time this script is invoked if [ "$checkvar" != "foo" ]; then exec perl /usr/script/myscript.pl else # ... stuff to do after the script has run fi
There may be a problem if the shell script is not being executed as part of a login sequence, as you can't assume the environment is trustworthy. I suspect in most cases all someone who fakes the variable is going to do is make the perl script fail to run...$ENV{checkvar}="foo"; exec "sh", "/usr/script/myshell.sh" # or, if you're logging in exec "sh", "-l"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: RE: chdir vs. shell behavior
by BBQ (Curate) on Jun 15, 2000 at 16:36 UTC |