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

Re: How to add dir to path



On Wed, 8 Aug 2007 18:38:49 +0200
"Manon Metten" <manon.metten@gmail.com> wrote:

> Hi,
> 
> This thread ain't over yet. Apart from using ~/bin (as Andrei Popescu
> suggested) I noticed that adding 'export PATH=$HOME/scripts:$PATH'
> to the end of ~/.bash_profile, the newly added dir is not available in
> any new session I open. However, when I open a new bash window,
> the new dir is available. Something like this:
> 
> Bash Win1
>   - Session 1: ~/scripts   YES
>   - Session 2: ~/scripts    NO
>     ...
>   - Session X: ~/scripts    NO
> 
> Bash Win2:
>   - Session 1: ~/scripts   YES
>   - Session 2: ~/scripts    NO
>     ...
>   - Session X: ~/scripts    NO
> 
> etc.
> 
> So just to try, I've put 'export PATH=$HOME/scripts:$PATH' in
> /etc/profile but that didn't make any difference. Then I placed it
> in ~/.bashrc and yep! ~/scripts available in every session.
> 
> Is this default behavior or don't I just understand it?
> 
> Manon.

Adding $HOME to /etc/profile should not work the way you want it to.
These settings are global, consider them as "executed by root", so in
this case $HOME will resolve as /root, not /home/manon as you may have
expected.
I think the other problem is related to the mode you start a terminal
session, whether or not bash is a login shell. There was further
information in this thread before.

-- 
Szia:
		Nyizsa.

----------------------------------------------------------------------
Get a free email address with REAL anti-spam protection.
http://www.bluebottle.com/tag/1



Reply to: