From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Setting environment variables in .bashrc vs .bash_profile Date: Sun, 12 Oct 2014 23:10:31 +0200 Message-ID: <878ukluh88.fsf@gnu.org> References: <87oatmch5i.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87siix59cs.fsf@gnu.org> <87r3yg1wpp.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <871tqgdt3o.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87y4sn9900.fsf@gnu.org> <87fvevdcfu.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87siivabzg.fsf@gnu.org> <877g07d0zd.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <8761fq99mr.fsf@gnu.org> <87y4slyk2k.fsf_-_@netris.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]:40172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdQPN-0000Mw-SD for guix-devel@gnu.org; Sun, 12 Oct 2014 17:10:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XdQPJ-0000uG-1z for guix-devel@gnu.org; Sun, 12 Oct 2014 17:10:29 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:56098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XdQPI-0000u8-RT for guix-devel@gnu.org; Sun, 12 Oct 2014 17:10:24 -0400 In-Reply-To: <87y4slyk2k.fsf_-_@netris.org> (Mark H. Weaver's message of "Sun, 12 Oct 2014 00:43:15 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mark H Weaver Cc: guix-devel@gnu.org Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> I just noticed that =E2=80=98guix environment foo=E2=80=99, without -E, = doesn=E2=80=99t work for >> me because my .bashrc & co. reset PATH, CPATH, etc. >> >> Conversely, =E2=80=98guix environment foo -E /bin/sh=E2=80=99 works, bec= ause when >> invoked as =E2=80=98sh=E2=80=99, Bash does not read .bashrc. >> >> I=E2=80=99m not sure if it=E2=80=99s something wrong with my Bash initia= lization files >> or something that might affect others. WDYT? > > FWIW, I've always put my environment variable settings in .bash_profile > instead of .bashrc for this reason. I want to be able to set up an > alternate environment and launch interactive subshells without resetting > everything. OK. (I never took the time to understand what=E2=80=99s supposed to go in .bashrc and what=E2=80=99s supposed to go in .bash_profile; now=E2=80=99s t= he time to fix it. ;-)) > I vaguely remember noticing that the standalone Guix system set things > up in such a way that my environment was reset in every interactive > shell. If so, I would be in favor of changing that. /etc/profile defines a bunch of environment variables (see gnu/system.scm.) In turn, new user accounts get a default .bashrc (see shadow.scm) that sources /etc/profile. If I got it right, it should be called .bash_profile instead of .bashrc, and should source .bashrc when present? > On the other hand, I end up with > /gnu/store/10fr8jbnrb3gzyc0967m7ar64ch9ggk8-windowmaker-0.95.6/bin in > front of my PATH within my entire X session, because of our windowmaker > wrapper. Yeah, another bug that needs to be fixed. Could you file it? Thanks, Ludo=E2=80=99.