.bashrc and .bash_profile
Art Wildman
Art.Wildman at noaa.gov
Tue Nov 6 16:21:26 UTC 2007
Global or application specific changes applied to all/groups of users go
into separate ENV/Shell scripts placed into /etc/profile.d, those are
called (sourced) from /etc/bashrc and /etc/profile. New users default
scripts & env settings come from /etc/skel. Usually ENV setting go into
~/.bashrc (which effect all non-interactive sessions) and interactive
settings (term keymap settings) go into ~/.bash_profile.
See also...
info bash
help
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
Bash by example, Part 1-3 -
http://www.ibm.com/developerworks/library/l-bash.html
http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/index.html
Adv Bash-Scripting Guide - http://www.tldp.org/guides.html#abs
BASH Ref Manual -http://www.gnu.org/software/bash/manual/bashref.html
-HTH Art
Zhou, Jingchen wrote:
> 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
>
>
>
> ------------------------------------------------------------------------
>
> --
> redhat-sysadmin-list mailing list
> redhat-sysadmin-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-sysadmin-list
More information about the redhat-sysadmin-list
mailing list