guix-devel
[Top][All Lists]
Advanced

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

Re: use zsh as login shell


From: Mark H Weaver
Subject: Re: use zsh as login shell
Date: Fri, 05 Dec 2014 00:11:29 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> 宋文武 <address@hidden> skribis:
>
>> +  (mlet %store-monad ((bash-profile (text-file "bash_profile" "\
>> +# honor ~/.bashrc if the shell is interactive
>> +[[ $- == *i* ]] && source ~/.bashrc
>
> I don’t think the test is needed, because ~/.bash_profile is only read
> by interactive Bash.

Indeed.  However, it would be good to check if ~/.bashrc exists.
Section 6.2 of the Bash manual suggests this:

  if [ -f ~/.bashrc ]; then . ~/.bashrc; fi

>> +# load system-wide environment varibales
>> +source /etc/environment
>> +
>> +# common varibales for user profile
>> +export PATH=$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin:$PATH
>> +export INFOPATH=$HOME/.guix-profile/share/info:$INFOPATH\n"))
>> +                      (bashrc (text-file "bashrc" "\
>> +PS1='address@hidden \\w\\$ '
>
> I think PS1 should go to /etc/profile.  WDYT?

I agree with 宋文武 that the PS1 setting belongs in the default
~/.bashrc skeleton.  I would prefer to keep settings like this, that are
purely a matter of personal taste, out of system-wide files.  Also,
/etc/profile is read by other shells, and I don't know that the syntax
above is portable.

    Regards,
      Mark



reply via email to

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