On Thu, Sep 05, 2002 at 11:46:58AM +0530, Prashanth wrote:
> ####[ Linux One Stanza Tip (LOST) ]###########################
> 
> Sub : BASH and non-login shells                      LOST #099
> 
> For non login-in shells (like xterm and rxvt)  under BASH, the
> file which gets read is ".bash_profile".  Settings in  .bashrc 
> may not be otherwise effective under X. Copy  contents of your
> .bashrc to .bash_profile to enable customised resources.
> 
> ####<[EMAIL PROTECTED]>########################################

Hey this is totally the other way round. For non login shells, the file
that gets read is .bashrc. Its .bash_profile (and .bash_login/.profile,
if .bash_profile does not exist) for login shells. Quote from bash's
man page:

       When bash is invoked as an interactive login shell, or as a
       non-interactive 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 --noprofile option may be used when the shell is
       started to inhibit this behavior.

And later:

       When an interactive shell that is not a login shell is started,
       bash reads and executes commands from ~/.bashrc, if that file
       exists. This may be inhibited by using the --norc option.
       The --rcfile file option will force bash to read and execute
       commands from file instead of ~/.bashrc.

For non-interactive non-login shells (say, to execute a shell script via
the shebang mechanism), the file that gets read is specified in $BASH_ENV.

Binand

-- 
If you found this helpful, please take some time off to rate it:
http://svcs.affero.net/rm.php?r=binand


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to