public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: David Harel <hareldvd@ergolight-sw.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] man bash document doesn't match real life bash.
Date: Sat, 22 Sep 2007 22:12:09 +0200	[thread overview]
Message-ID: <46F57719.6040904@ergolight-sw.com> (raw)
In-Reply-To: <20070919142308.259ef440@zaphod.digimed.co.uk>

As Etaoin Shrdlu said, bash does not even start /etc/profile. Below grep
on strace output on bash:
$ grep profile /tmp/bash.trace
$
$ # My comment, it got nothing
$ grep bashrc /tmp/bash.trace
open("/etc/bash/bashrc", O_RDONLY|O_LARGEFILE) = 3
read(3, "# /etc/bash/bashrc\n#\n# This file"..., 2540) = 2540
open("/home/harel/.bashrc", O_RDONLY|O_LARGEFILE) = 3


Neil Bothwick wrote:
> 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
>
>
>   

-- 
Regards.

David Harel,

==================================

Home office +972 77 7657645
Fax:        +972 77 7657645
Cellular:   +972 54 4534502
Snail Mail: Amuka
            D.N Merom Hagalil
            13802
            Israel
Email:      hareldvd@ergolight-sw.com


-- 
gentoo-user@gentoo.org mailing list



  parent reply	other threads:[~2007-09-22 19:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 15:03 [gentoo-user] man bash document doesn't match real life bash David Harel
2007-09-19 13:23 ` Neil Bothwick
2007-09-19 13:43   ` Etaoin Shrdlu
2007-09-22 20:12   ` David Harel [this message]
2007-09-23  3:19     ` Mrugesh Karnik
2007-09-23  8:35       ` Etaoin Shrdlu
2007-09-19 13:36 ` Albert Hopkins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46F57719.6040904@ergolight-sw.com \
    --to=hareldvd@ergolight-sw.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox