unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Re: Setting environment variables in .bashrc vs .bash_profile
Date: Sun, 12 Oct 2014 23:10:31 +0200	[thread overview]
Message-ID: <878ukluh88.fsf@gnu.org> (raw)
In-Reply-To: <87y4slyk2k.fsf_-_@netris.org> (Mark H. Weaver's message of "Sun, 12 Oct 2014 00:43:15 -0400")

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (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	other threads:[~2014-10-12 21:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 22:48 [PATCH] scripts: Add 'environment' command David Thompson
2014-10-09  6:44 ` Alex Kost
2014-10-09 16:50 ` Eric Bavier
2014-10-09 16:54   ` Thompson, David
2014-10-09 17:26     ` Eric Bavier
2014-10-09 19:30 ` Ludovic Courtès
2014-10-10  2:32   ` David Thompson
2014-10-10 12:09     ` David Thompson
2014-10-10 16:37       ` Ludovic Courtès
2014-10-10 18:09         ` David Thompson
2014-10-10 20:47           ` Ludovic Courtès
2014-10-10 22:16             ` David Thompson
2014-10-11 10:35               ` Ludovic Courtès
2014-10-11 12:27                 ` David Thompson
2014-10-11 21:52                   ` Ludovic Courtès
2014-10-12  4:43                 ` Setting environment variables in .bashrc vs .bash_profile Mark H Weaver
2014-10-12 21:10                   ` Ludovic Courtès [this message]

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878ukluh88.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mhw@netris.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).