Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Mar 2004 08:25:20 +0000
From:      Peter Risdon <peter@circlesquared.com>
To:        gerard-seibert@rcn.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Search Path in Bash
Message-ID:  <4042F370.40502@circlesquared.com>
In-Reply-To: <20040229180148.B693.GERARD-SEIBERT@rcn.com>
References:  <20040229192222.A7D0816A4EC@hub.freebsd.org> <20040229180148.B693.GERARD-SEIBERT@rcn.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Gerard Seibert wrote:

>Peter Risdon writes:
>  
>
>>When  bash is invoked as an interactive login shell, or as a non-inter-
>>      active shell with the --login option, it first reads and 
>>executes  com-
>>      mands  from  the file /etc/profile, if that file exists.  After 
>>reading
>>      that file, it looks for ~/.bash_profile, ~/.bash_login, and 
>>~/.profile,
>>      in  that order, and reads and executes commands from the first 
>>one that
>>      exists and is readable.  The --noprofile option may be  used  
>>when  the
>>      shell is started to inhibit this behavior.
>>
>>
>>    
>>
>
>********** Reply Separator **********
>Sunday, February 29, 2004 6:01:48 PM
>
>Peter, you stated the following:
>
>When  bash is invoked as an interactive login shell, or as a non-inter-active
>shell with the --login option, it first reads and executes  commands 
>from  the file /etc/profile, if that file exists.  After reading that
>file, it looks for ~/.bash_profile, ~/.bash_login, and >~/.profile, in 
>that order, and reads and executes commands from the first one that
>exists and is readable
>  
>
The credit has been lost along the way, but I was quoting the man page.

>If I am following you correctly, then having a ~/,bashrc, ~/.bashrc or
>~/.profile file is worthless, if bash reads only the first file that it
>finds. I am referring in this scenario to the ~/.bash_profile file.
>  
>
I haven't ever tried multiple ~/.bashconfigfiles. FWIW, the idea that 
more than one might get read seems a little scary. If it was, trying to 
debug unexpected bash behaviour would certainly lead to a head-shaped 
crater in the wall by my desk.

>That isn't exactly what I gleamed from the "FreeBSD" book by Annelise
>Anderson. Perhaps what she is referring to is an older version of bash.
>  
>
I'm sorry, but I haven't read this.

>I am not insinuating that you are incorrect; I am just trying to get
>the most accurate information in regards to how bash works.
>  
>
Absolutely.

PWR.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4042F370.40502>