[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: Why two files?? (Re: Linux Startup file)



On Tue, Jun 01, 1999 at 11:04:57AM +0530, manas garg wrote:
> On Tue, 1 Jun 1999, V S Ashoka wrote:
> 
> > 	Two of them, .bashrc and .bash_profile (provided you use bash
> > shell)
> > ashok
> > 
> 
> Hi,
> 
> Now that this issue has been taken up, I always wanted to know why there
> are 2 files while one can do?
> 

Bash can be used in two different ways - one as your login shell (as
noted in the /etc/passwd file against your login name) and as a
general shell (either while executing a shell script or by just typing
bash at your command prompt). .bash_profile is the startup file for
bash's login shell feature, and .bashrc for the other. Anyway, when
you invoke bash from the command prompt, you can specify the -i option
to bash to make it behave as a login shell (if it is listed in
/etc/shells, I believe). Redhat's default bash profile file has the
lines

if [ -f ~/.bashrc ]; then
   source ~/.bashrc
fi

in it. I personally prefer to symlink the two files.

Read the bash man page, and look into the environment variable SHLVL.

Regards,

Binand

- --------------------------------------------------------------------
For more information on Linux in India visit http://www.linux-india.org/
To unsubscribe from this list send an email to majordomo@xxxxxxxxx with the
words 'unsubscribe linux-india' (without the quotes) in the body of the
email.

------------------------------

End of Linux India Digest V1 #17
********************************

--------------------------------------------------------------------
To unsubscribe send an email to majordomo@xxxxxxxxx with the word
'unsubscribe linux-india-digest' (without the quotes) in the body
of the email.