.bashrc and .bash_profile

Zhou, Jingchen jingchen at slac.stanford.edu
Fri Nov 2 20:58:12 UTC 2007


Good. 
Where do you recommend to put ENV.bash (an environment setup for the group), in .bashrc or in .bash_profile?

________________________________

From: redhat-sysadmin-list-bounces at redhat.com on behalf of James Olin Oden
Sent: Fri 11/2/2007 11:18 AM
To: redhat-sysadmin-list at redhat.com
Subject: Re: .bashrc and .bash_profile



On 11/2/07, Zhou, Jingchen <jingchen at slac.stanford.edu> wrote:
> I am new to bash. It looks like there are two initialization files .bashrc and
> .bash_profile in $HOME which are generated when creating new accounts on
> Linux.

I'll try to answer, but if I'm wrong someone please correct me.

> Why there are two? What is each one for?
.bash_profile is meant for login shells and interactive sessions.
.bashrc is used for
non-interactive sessions.  They effectively both get sourced in, but
you never want
to put stuff in .bashrc that would cause stuff to be displayed, or
worse ask for
user input.

> Can I make them as one, e.g. moving things from  .bash_profile to .bashrc, and
> only use .bashrc?
Yes provided you take into account what I said above.

>
> Thanks,
Your welcome...james

--
redhat-sysadmin-list mailing list
redhat-sysadmin-list at redhat.com
https://www.redhat.com/mailman/listinfo/redhat-sysadmin-list


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 4274 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/redhat-sysadmin-list/attachments/20071102/62f05368/attachment.bin>


More information about the redhat-sysadmin-list mailing list