[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash login script problems...



Derrick 'dman' Hudson wrote:
Neal Lippman wrote:
| I am having two problems with bash login scripts, which I cannot seem to sort | out. Probably something simple, but I'm missing it. | | 1. First, here is a few lines from my .bash_profile. These lines were | commented out by default, and I have uncommented them. | I have verified, by adding some echo statements, that the body of the if | clause IS being executed when I issue './.bash_profile' and so my ~/bin dir ^^^^^^^^^^^^^^^ > | should be getting added to my path. However, after the script completes, | 'echo $PATH' does NOT show any change to my path shell variable. | | What am I missing here?

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?
sincerely,
--
Ivo Wever
I.J.W.Wever@student.tnw.tudelft.nl


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: