On Wed, Jun 19, 2002 at 04:50:14PM +0200, Ivo Wever wrote:
> Derrick 'dman' Hudson wrote:
> >When you run a script in a subshell, it can modify the environment of
> >that subshell, then that subshell terminates (when the script is done)
> >and you get the prompt from your original shell again.  Unlike MS-DOS,
> >scripts normally run in subshells and can't wreak havoc on your
> >environment.  If you want to run the script in the current shell, use
> >one of the following commands :
> >    . ./.bash_profile
> >    source ./.bash_profile
> 
> Isn't this (changing $PATH from a script) what the 'export' command is
> for?

Unfortunately not. 'export' makes variables visible to subprocesses of a
script, but not to the parent process (in other words, the shell from
which you called that script).

-- 
Colin Watson                                  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to