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

Re: PATH question



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?!

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.

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.

But if you prefer to be lazy, then sure, go ahead and use .bashrc and
end up with repeated eternally long PATH entries.


Reply to: