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

Re: How To Permanently Add-to a Users PATH Statement in the Bash Shell



On Tue 07 Jul 2020 at 20:20:11 (-0400), Roberto C. Sánchez wrote:
> On Wed, Jul 08, 2020 at 09:59:52AM +1000, Zenaan Harkness wrote:
> > On Tue, Jul 07, 2020 at 10:29:47AM -0400, Greg Wooledge wrote:
> > > On Tue, Jul 07, 2020 at 03:17:37PM +0100, Jonathan Dowland wrote:
> > > > On Tue, Jul 07, 2020 at 04:14:16PM +0200, Nicolas George wrote:
> > > > > cd ~/bin
> > > > > ln -s ../opt/something/bin/something
> > > > 
> > > > Not in the default PATH either.
> > > 
> > > $HOME/bin is placed into the user's default PATH by Debian's ~/.profile
> > > (the one in /etc/skel/.profile) if it exists at the time the ~/.profile
> > > is read, if the ~/.profile is read at all.
> > > 
> > > As I keep saying, of course, what dot files actually get read depends
> > > on how one logs in.
> > 
> > That souds mildly disconcerting - when does `~/.profile` _not_ get read?
> > 
> When the shell is invoked non-interactively, or when it is invoked
> interactively with --noprofile.  Note that the --login option will cause
> a non-interactive shell to read ~/.profile (along with other
> configuration files).

Some of us use ~/.bash_profile (and even ~/.bash_login) which will
override ~/.profile being read. Of course, you're best reading
man bash    for a fuller story of bash's machinations.

Cheers,
David.


Reply to: