guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting environment variables in .bashrc vs .bash_profile


From: Ludovic Courtès
Subject: Re: Setting environment variables in .bashrc vs .bash_profile
Date: Sun, 12 Oct 2014 23:10:31 +0200
User-agent: Gnus/5.130011 (Ma Gnus v0.11) Emacs/24.3 (gnu/linux)

Mark H Weaver <address@hidden> skribis:

> address@hidden (Ludovic Courtès) writes:
>
>> I just noticed that ‘guix environment foo’, without -E, doesn’t work for
>> me because my .bashrc & co. reset PATH, CPATH, etc.
>>
>> Conversely, ‘guix environment foo -E /bin/sh’ works, because when
>> invoked as ‘sh’, Bash does not read .bashrc.
>>
>> I’m not sure if it’s something wrong with my Bash initialization 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’s supposed to go in
.bashrc and what’s supposed to go in .bash_profile; now’s the 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’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]