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

Vram lamsokvr at xprt.net
Wed Nov 17 06:29:50 UTC 2004


On Tue, 2004-11-16 at 22:14 -0800, Vram wrote:
> On Wed, 2004-11-17 at 13:34 +0900, janne wrote:
> > tis 2004-11-16 klockan 20:20 -0800 skrev Bob Nielsen:
> > > 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.
> > 
> > Except that it will run again every time you start a shell (directly or
> > indirectly) from an earlier one, which will mean multiple entries in the
> > path. Not a big deal for the path setting itself - it's unlikely to add
> > more than a few entries - but it does mean you can't rely on setting
> > something there once, and once only.
> > 
> > So far, the only solution I've found is to use ~/.gnomerc, which is
> > wrong on so many levels. But, it does work.
> > 
> > 
> 
> 
> So the solution is....
> 
> <and I tested it>
> 
> Change .bash_profile as above.
> Uncomment the lines
> save it.
> 
> and in .gnomerc put
> 
> source .bash_profile
> 
> 
> Works great every time....
> 
> I logged out and in and out and it works..
> echo $PATH
> bin is there..
> 
> 
> 
> 
> goto  ctrl-alt-fX and login  
> echo $PATH
> bin is there
> 
> Do ssh.. Bin is there...
> 
> 
> 
> The other solution is to put those lines in .bashrc   
> 
> > #if [ -d ~/bin ] ; then
> > > #    PATH=~/bin:"${PATH}"
> > > #fi
> 
> You need to think how each shell is invoked..And .bashrc is read.
> 
> The only time you will get two bin is if you call the bash shell inside
> a bash shell.....
> 
> 
> HTH
> 
> Vram
> 
> 
> 





More information about the ubuntu-users mailing list