Order of .profile & .bashrc

Larry Hall (Cygwin) reply-to-list-only-lh@cygwin.com
Thu Dec 16 23:27:00 GMT 2010


On 12/16/2010 3:42 PM, jwzumwalt wrote:
>
>
> http://tiswww.case.edu/php/chet/bash/bash.html#lbAH
>    or
> $ man bash
>    or
> $ info bash
>
> Thank you for your reply... No mention is made of the following files :)
>
> /etc/bash.bashrc
> /etc/skel/.bash_profile
> /etc/skel/.inputrc
> $HOME/.bash_profile - commands inside this file only get executed by the
> login shell.
> /etc/X11/xinit/xinitrc – executed when xwindows start, startup programs
>

 From the bash man page:

        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.

 From your ~/.bash_profile file:

# source the system wide bashrc if it exists
if [ -e /etc/bash.bashrc ] ; then
   source /etc/bash.bashrc
fi

Files under /etc/skel are templates that get copied into user home directories
when they are first accessed.

xinitrc is from X.  See "man xinit".

-- 
Larry

_____________________________________________________________________

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list