/etc/profile and ~/.bash_profile are not being read

Bob Nielsen nielsen at oz.net
Wed Nov 17 04:20:12 UTC 2004


The default ~/.bash_profile file has

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi
 
and

# set PATH so it includes user's private bin if it exists
#if [ -d ~/bin ] ; then
#    PATH=~/bin:"${PATH}"
#fi
 
This will place ~/.bin in the $PATH for login shells only.  If that 
modification of $PATH is instead placed in ~/.bashrc, it should work in 
an X terminal, as well.

On Wed, Nov 17, 2004 at 11:52:31AM +0900, janne wrote:
> ons 2004-11-17 klockan 13:26 +1100 skrev Cameron Hutchison:
> > Once upon a time janne said...
> > > tis 2004-11-16 klockan 17:48 -0800 skrev Vram:
> > > 
> > > > It is my understanding that .bash_profile is read on login
> > > 
> > > It should be. It isn't. That is the basis of my question :)
> 
> [good explanation deleted]
> 
> > To get around this, I have my own .xsession that has a first line of
> > "#!/bin/bash -l". My startup is then done through the .xsession script,
> > after having loaded the bash environment. Users with different shells
> > would need a different first line to invoke their shell as a login
> > shell.
> 
> OK. Doing my own xsession feels more than a little overkill, just to get
> ~/bin into my path.
> 
> If I ask it in this way: why is /etc/X11/Xsession not using that
> hash-bang line, rather than the default /bin/sh? Ubuntu is defaulting to
> bash after all, so it would be reasonable.
> 
> Or ask in this way: How are other distributions doing this? It does work
> on other systems, without the need for each user to mess with xsession
> themselves.
> 
> A third question: why do /etc/profile and ~/.bash_profile exist at all,
> if they aren't used, and can't be used? It only confuses people to keep
> them.
> 
> Last, related question: the default paths are set _somewhere_. DOes
> anybody know where that would be, so I can add my stuff there?
> 




More information about the ubuntu-users mailing list