[NBLUG/talk] bash script wonder

sms at sonic.net sms at sonic.net
Tue Oct 5 12:51:32 PDT 2004


> This is a common mistake when writing shellscripts.  The script runs in
> a new instance of the shell which is a child of the interactive shell,
> and therefore the changes made to the environment don't propagate back
> up to the parent.
>    -- Mitch

<nod>

This is a *VERY* intentional behavior.  In general, scripts are often
set up to go "do something specific" -- very often, something demanding
a *different* suite of pathing/environment/libraries/etc from what an
interactive commandline-user wants to do.  Scripts, like other commands,
are "black box" phenomena that *shouldn't* affect the shell from which
the command is run.  Thus SUID programs don't propagate their ID's back
to the invoking shell, etc etc etc...

- Steve S.






More information about the talk mailing list