From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#29337: Bash reads system-wide bashrc unconditionally. Date: Fri, 17 Nov 2017 22:04:52 +0100 Message-ID: <87o9o039cb.fsf@gnu.org> References: <878tf5ksmq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46532) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFnot-0001aj-9M for bug-guix@gnu.org; Fri, 17 Nov 2017 16:05:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFnos-00011C-9b for bug-guix@gnu.org; Fri, 17 Nov 2017 16:05:03 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:36695) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eFnos-000112-5e for bug-guix@gnu.org; Fri, 17 Nov 2017 16:05:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eFnor-0003B9-O2 for bug-guix@gnu.org; Fri, 17 Nov 2017 16:05:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <878tf5ksmq.fsf@gnu.org> (Roel Janssen's message of "Fri, 17 Nov 2017 13:16:13 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Roel Janssen Cc: 29337@debbugs.gnu.org Hi, Roel Janssen skribis: > On CentOS 7, the following happens (yes, I added the echo-statement to > /etc/bashrc on CentOS as well): > $ env - bash --init-file <(echo "echo \"Goodbye, world\"") -i > Goodbye, world > > On GuixSD: > $ env - bash --init-file <(echo "echo \"Goodbye, world\"") -i > Hello, world > Goodbye, world > > Where does this difference come from? And could we make its behavior > similar to CentOS 7, and more importantly, to the description in the > manpage? By default GuixSD=E2=80=99s /etc/profile (sourced by interactive shells) do= es this: --8<---------------cut here---------------start------------->8--- if [ -n "$BASH_VERSION" -a -f /etc/bashrc ] then # Load Bash-specific initialization code. . /etc/bashrc fi --8<---------------cut here---------------end--------------->8--- It comes from commit 1d167b6e3779bcc1666b5c7d5ee802170c7023b6, which was about loading the Bash completion code. Looking at the manual (info "(bash) Bash Startup Files"), I think that /etc/bashrc is ignored by default. Thus it=E2=80=99s up to users/distros to decide what to do with it, IIUC. Thoughts? Ludo=E2=80=99.