From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1IZN0Z-00032Z-4q for garchives@archives.gentoo.org; Sun, 23 Sep 2007 08:40:07 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l8N8UjBG029445; Sun, 23 Sep 2007 08:30:45 GMT Received: from dcnode-01.unlimitedmail.net (static-adsl-b-16-58.ipcom.comunitel.net [212.145.239.58] (may be forged)) by robin.gentoo.org (8.14.1/8.14.0) with ESMTP id l8N8QY4n024732 for ; Sun, 23 Sep 2007 08:26:34 GMT Received: from ppp.zz ([137.204.208.98]) (authenticated bits=0) by dcnode-01.unlimitedmail.net (8.14.0/8.14.0) with ESMTP id l8N8QOjw021792 for ; Sun, 23 Sep 2007 10:26:25 +0200 From: Etaoin Shrdlu 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 User-Agent: KMail/1.9.7 References: <46F13A34.4080201@ergolight-sw.com> <46F57719.6040904@ergolight-sw.com> <200709230849.34854.mrugeshkarnik@gmail.com> In-Reply-To: <200709230849.34854.mrugeshkarnik@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709231035.43182.shrdlu@unlimitedmail.org> X-UnlimitedMail-MailScanner: Found to be clean X-UnlimitedMail-MailScanner-From: shrdlu@unlimitedmail.org X-Spam-Status: No X-Archives-Salt: 45bc52e7-720b-4f33-8a6a-a2f9dd554197 X-Archives-Hash: bdac64c650165f2e880da7db6eef150a 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. > > > > 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