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

Re: Debianly Correct place to add ~/bin to $PATH ?



On 20131210_003428, Reco wrote:
>  Hi.
> 
> On Mon, 9 Dec 2013 12:15:53 -0700
> Paul E Condon <pecondon@mesanetworks.net> wrote:
> 
> > I see the file ~/.profile . It contains code that tests for the
> > existence of ~/bin/ and adds it to $PATH , if it exists.  But it
> > doesn't 'work'. After I have created my ~/bin/.  and filled it with
> > some scripts, and rebooted, there is still no mention of ~/bin/ in
> > $PATH . Why? When does ~/.profile actually get invoked?
> 
> I assume you're using bash as a shell.

Yes, bash as the shell is the way the netinst CD sets it up

> According to bash(1) (INVOCATION part):
> 
> When bash is invoked as an interactive login shell, or as a
> non-interactive shell with the --login option, it first reads and
> executes commands from the file /etc/profile,  if  that  file
> exists. After  reading that file, it looks for ~/.bash_profile,
> ~/.bash_login, and ~/.profile, in that order, and reads and executes
> commands from the first one that exists and is readable.

There is already a ~/.profile set up by the netinst process. It is the
code in that file that has words testing for existence of ~/bin and
modifying $PATH. My nieve belief was that that code is there because
under some situation expected by the netinst developers it will be
useful to have it there --- like when the system boots up or some
such. I know there are legacy systems with dead code that nobody
removes because nobody has the authority to do so. But that surely
doesn't apply to Debian. Why are those few lines there? I want to have
~/bin in the $PATH and I supposed that the cleanest way to get ~/bin
in the $PATH would be to arrange to have that code properly invoked
--- but it seems to be a more devious design than I supposed.

> 
> So, the most possible reason of your modifications of ~/.profile are
> ignored because you have ~/.bash_profile or ~/.bash_login.

The netinst CD does not create either of these files. They are not
there to be invoked.

> 
> Does invoking '. ~/.profile' fix things?

I can manually invoke the code, but the comments in the file say that
it is invoke only at login. I'm asking 'How does this happen?' I's
thinking that for some reason that is probably blinding obvious to
those who already know. But I don't already know.

> 
> 
> > Is there some 
> > part of the boot process that must be configured in order to invoke
> > it?
> 
> Hardly, IMO. Shell configuration files are independent of boot process.
> 
> 
> Reco
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 20131210003428.8de15823adecd8cd164a86b3@gmail.com">http://lists.debian.org/[🔎] 20131210003428.8de15823adecd8cd164a86b3@gmail.com
> 

-- 
Paul E Condon           
pecondon@mesanetworks.net


Reply to: