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

Re: PATH question



On Tuesday 04 August 2020 15:46:05 Gene Heskett wrote:

> On Tuesday 04 August 2020 14:57:49 Greg Wooledge wrote:
> > On Tue, Aug 04, 2020 at 02:49:00PM -0400, Gene Heskett wrote:
> > > > If so, are you logging in via sddm,
> > > > which is what KDE on Debian normally uses?
> > >
> > > probably not, but I'm talking about my own shell, which is
> > > probably started by the tde version of lightdm.
> >
> > So you've configured lightdm to perform an autologin?  Yikes.
> >
> > Well, it probably goes through the Debian X11 session which means
> > you configure environment stuff in ~/.xsessionrc.
> >
> > > > the ~/.bashrc file, which will pick up the PATH change.  When
> > > > all of the windows have been re-shelled, you can edit ~/.bashrc
> > > > again to remove the PATH=... command, since you don't want it to
> > > > stay there.
> > >
> > > But I do want it to remain, just like the $HOME/bin that prefaces
> > > to $PATH I can see with an echo $PATH right now.
> >
> > But you said .profile in the first email.  I said .bashrc.  Now
> > you're saying that you're actually using .bashrc and not .profile?!
>
> I did, because that is where I found the existing $PATH defined. There
> is no mention of PATH in my .bashrc.
>
> > The problem with putting PATH=... in .bashrc is that it gets read by
> > each shell that starts up.  If you ever have a nested set of shells
> > (e.g. you start a terminal with a shell in it, which is shell level
> > one, and then you run an editor, and then from the editor you
> > perform a shell escape, which is now shell level two...) then you
> > end up with duplicate entries in PATH.
>
> Yes, pita to clear them out too.
>
> > In the most degenerate cases you can end up with
> > PATH=/foo:/foo:/foo:....
> >
> > That's why you usually try to put some effort into finding the *one*
> > place that you can add a directory to your PATH *one* time, without
> > breaking anything.
>
> Precisely.
>
> > But if you prefer to be lazy, then sure, go ahead and use .bashrc
> > and end up with repeated eternally long PATH entries.
>
> And thats a bad dog, no biscuit.
>
> Thanks. I guess I'll reboot but that rather resembles using a
> sledgehammer on a gnat.  So since I don't seem to able to express what
> I want with the whole world assuming I am logging in from a remote
> terminal, I'll close the thread with a reboot as I can setup the rest
> of my working env in 10 to 15 minutes, what I was trying to avoid.
>
> Thank you
> Cheers, Gene Heskett

And that worked.


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: