public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Etaoin Shrdlu <shrdlu@unlimitedmail.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] man bash document doesn't match real life bash.
Date: Sun, 23 Sep 2007 10:35:42 +0200	[thread overview]
Message-ID: <200709231035.43182.shrdlu@unlimitedmail.org> (raw)
In-Reply-To: <200709230849.34854.mrugeshkarnik@gmail.com>

On Sunday 23 September 2007, Mrugesh Karnik wrote:

> From man bash:
>
> ``When  bash  is  invoked as an interactive login shell, or as a
> non-interactive shell with the --login option, it first reads and
> executes commands 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.
>
> <snip>
>
> When  an  interactive shell that is not a login shell is started, bash
> reads and executes commands from ~/.bashrc, if that file exists.  This
> may be inhibited by using the --norc option.  The --rcfile file option
> will force bash to read and execute commands from file instead of
> ~/.bashrc.''

And this last is the part that fails to mention that a non-login shell 
will read /etc/bash/bashrc before ~/.bashrc, as the comments 
inside /etc/bash/bashrc and David Harel say.

Ok, after closer inspection, it seems that the /etc/bash/ way is a 
gentooism. Bash would normally define SYS_BASHRC and SYS_BASH_LOGOUT 
as /etc/bash.bashrc and /etc/bash.bash_logout respectively, even though 
it does not use them by default (they are commented in the sources). 
Nearly all linux distros uncomment those definitions, thus making bash 
use those files (see eg ubuntu). A gentoo patch, namely 
bash-3.0-configs.patch, changes those into /etc/bash/bashrc 
and /etc/bash/bash_logout. See bug #26952 (esp. from comment #52) and 
bug #90488 for further details. Note that gentoo applies the patch 
regardless of the vanilla USE flag.

So, it seems that, after all, the standard man page is correct, but, in 
gentoo, it probably should be patched to reflect the way things work in 
gentoo. Not sure whether this is enough to be worth a bug report?
-- 
gentoo-user@gentoo.org mailing list



  reply	other threads:[~2007-09-23  8:40 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
2007-09-23  3:19     ` Mrugesh Karnik
2007-09-23  8:35       ` Etaoin Shrdlu [this message]
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=200709231035.43182.shrdlu@unlimitedmail.org \
    --to=shrdlu@unlimitedmail.org \
    --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