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

Re: Re (2): ~/.profile



peasthope@shaw.ca wrote:
> Another puzzle.  I have two Squeeze systems which are almost identical. 
> In both, my entry in /etc/passwd is the same and I added this line at 
> the end of ~/.profile.
> 
> export EDITOR=vi

Because .profile is the "generic" shell side of things it is better to
use the generic

  EDITOR=vi
  export EDITOR

than to use the more compact but newer combined form.  If this were in
your ~/.bash_profile then the newer form is definitely safe because
only bash reads ~/.bash_profile.  But ~/.profile is the "lowest common
denominator" file for all Bourne-shell-like shells.  You might notice
that Debian's default file (/etc/skel/.profile) uses bash syntax
inside of an if statement checking for bash for just that reason.

> On one system "echo $EDITOR" confirms the setting.  On the other system 
> the setting is absent.  Where should I look to understand this?

How are you logging into these two different machines?

It is a long story but normally when logging in through a graphical
display manager such as xdm/gdm/gdm3/kdm/lightdm then in that case the
long story is that different distros do it differently and Debian
hasn't by default been invoking the shell as a login shell and
therefore when logging in this way the ~/.profile isn't sourced.  I
think it is a bug.  The topic gets discussed here every so often.  I
can't remember if this has been fixed recently or not and no time to
research it at this moment.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: