On Wed, 19 Sep 2007 17:03:16 +0200, David Harel wrote:

> I was surprised to find that in man bash the reference to initialization
> files is wrong. The bash manual says it reads initialization files from
> /etc/profile:
> FILES
>        /bin/bash
>               The bash executable
>        /etc/profile
>               The systemwide initialization file, executed for login
> shells
> 
> 
> Where real life uses /etc/bash/bashrc
> This part is taken from strace dump: strace bash -i
> open("/etc/bash/bashrc", O_RDONLY|O_LARGEFILE) = 3

It reads both, this is from /etc/profile

if [ -n "${BASH_VERSION}" ] ; then
    # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1
    # including color.  We leave out color here because not all
    # terminals support it.
    if [ -f /etc/bash/bashrc ] ; then
        # Bash login shells run only /etc/profile
        # Bash non-login shells run only /etc/bash/bashrc
        # Since we want to run /etc/bash/bashrc regardless, we source it
        # from here.  It is unfortunate that there is no way to do
        # this *after* the user's .bash_profile runs (without putting
        # it in the user's dot-files), but it shouldn't make any
        # difference.
        . /etc/bash/bashrc


-- 
Neil Bothwick

"Come on! It's a whole new life out there!"
"Oh, no. Not another one!"

Attachment: signature.asc
Description: PGP signature

Reply via email to