Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #225844 > unrolled thread

PATH question

Started byGene Heskett <gheskett@shentel.net>
First post2020-08-04 18:30 +0200
Last post2020-08-04 22:10 +0200
Articles 6 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  PATH question Gene Heskett <gheskett@shentel.net> - 2020-08-04 18:30 +0200
    Re: PATH question Greg Wooledge <wooledg@eeg.ccf.org> - 2020-08-04 18:40 +0200
      Re: PATH question Gene Heskett <gheskett@shentel.net> - 2020-08-04 20:50 +0200
        Re: PATH question Greg Wooledge <wooledg@eeg.ccf.org> - 2020-08-04 21:00 +0200
          Re: PATH question Gene Heskett <gheskett@shentel.net> - 2020-08-04 21:50 +0200
            Re: PATH question Gene Heskett <gheskett@shentel.net> - 2020-08-04 22:10 +0200

#225844 — PATH question

FromGene Heskett <gheskett@shentel.net>
Date2020-08-04 18:30 +0200
SubjectPATH question
Message-ID<AA7Z7-2du-1@gated-at.bofh.it>
Greeting all;

This box is on stretch.

I just created a /home/me/AppImage directory, moved some appimages into 
it, and added another stanza to add that to my .profile. Do I have to 
logout the 15 processes or so I have running now and effectively restart 
the system to make that path take effect?  Closing all konsole sessions 
on this workspace and opening fresh konsole's is not bringing that path 
into effect.
  
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>

[toc] | [next] | [standalone]


#225845

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2020-08-04 18:40 +0200
Message-ID<AA88N-2gT-5@gated-at.bofh.it>
In reply to#225844
On Tue, Aug 04, 2020 at 12:25:11PM -0400, Gene Heskett wrote:
> I just created a /home/me/AppImage directory, moved some appimages into 
> it, and added another stanza to add that to my .profile. Do I have to 
> logout the 15 processes or so I have running now and effectively restart 
> the system to make that path take effect?  Closing all konsole sessions 
> on this workspace and opening fresh konsole's is not bringing that path 
> into effect.

It depends on several things.  You say you're using konsole, so does
that mean you're running KDE?  If so, are you logging in via sddm,
which is what KDE on Debian normally uses?  If all of those things are
true, then editing .profile probably doesn't do anything at all.  An
sddm login running a Debian X11 session which runs KDE shouldn't
be reading the .profile file.  Ever.

Are you logging in on a console and running startx?  In that case,
your .profile *will* be read, by your console login shell, and the
changes to PATH and other environmental bits and bobs will all be
inherited by the X11 session, then by the window manager, then by
the terminals which are children of the window manager, and then by
the shell run inside the terminal, and then by the programs launched
by the shell.

If you aren't using startx from a console login, then the right place
to make modifications to PATH would be in the ~/.xsessionrc file.

I *just* got done saying all this stuff last week.

Now, your immediate question was how to make the PATH change take
effect in all of your existing terminal windows, without having to
log out and back in.  There's no single command that'll just blast
it out to all of them.  Each one is an independent self-contained
process, with its own separate copy of the environment.  You'll
have to go around to each window, one by one.

The most straightforward way to do it would be to paste your PATH=...
command into each window.

If you don't like that approach, you could add your PATH=... to
your ~/.bashrc file (assuming you use bash) temporarily.  Then in
each window, run "exec bash" to run a new shell, which will read
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.

[toc] | [prev] | [next] | [standalone]


#225852

FromGene Heskett <gheskett@shentel.net>
Date2020-08-04 20:50 +0200
Message-ID<AAaaB-3tj-1@gated-at.bofh.it>
In reply to#225845
On Tuesday 04 August 2020 12:34:21 Greg Wooledge wrote:

> On Tue, Aug 04, 2020 at 12:25:11PM -0400, Gene Heskett wrote:
> > I just created a /home/me/AppImage directory, moved some appimages
> > into it, and added another stanza to add that to my .profile. Do I
> > have to logout the 15 processes or so I have running now and
> > effectively restart the system to make that path take effect? 
> > Closing all konsole sessions on this workspace and opening fresh
> > konsole's is not bringing that path into effect.
>
> It depends on several things.  You say you're using konsole, so does
> that mean you're running KDE? 

No. TDE uptodate r14.

> 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.
 
> If all of those things are 
> true, then editing .profile probably doesn't do anything at all.  An
> sddm login running a Debian X11 session which runs KDE shouldn't
> be reading the .profile file.  Ever.
>
> Are you logging in on a console and running startx?

No, x is self starting.  The shells I open are on one of 8 or so on one  
of many "workspaces".

> In that case, 
> your .profile *will* be read, by your console login shell, and the
> changes to PATH and other environmental bits and bobs will all be
> inherited by the X11 session, then by the window manager, then by
> the terminals which are children of the window manager, and then by
> the shell run inside the terminal, and then by the programs launched
> by the shell.
>
> If you aren't using startx from a console login, then the right place
> to make modifications to PATH would be in the ~/.xsessionrc file.
>
> I *just* got done saying all this stuff last week.
>
> Now, your immediate question was how to make the PATH change take
> effect in all of your existing terminal windows, without having to
> log out and back in.  There's no single command that'll just blast
> it out to all of them.  Each one is an independent self-contained
> process, with its own separate copy of the environment.  You'll
> have to go around to each window, one by one.
>
> The most straightforward way to do it would be to paste your PATH=...
> command into each window.
>
> If you don't like that approach, you could add your PATH=... to
> your ~/.bashrc file (assuming you use bash) temporarily.  Then in
> each window, run "exec bash" to run a new shell, which will read
> 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. In effect making "freecad" 
look for its appimage there, before spending another second scanning the 
rest of the env looking for it.

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>

[toc] | [prev] | [next] | [standalone]


#225854

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2020-08-04 21:00 +0200
Message-ID<AAakh-3wC-5@gated-at.bofh.it>
In reply to#225852
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.

[toc] | [prev] | [next] | [standalone]


#225856

FromGene Heskett <gheskett@shentel.net>
Date2020-08-04 21:50 +0200
Message-ID<AAb6F-42X-3@gated-at.bofh.it>
In reply to#225854
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
-- 
"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>

[toc] | [prev] | [next] | [standalone]


#225857

FromGene Heskett <gheskett@shentel.net>
Date2020-08-04 22:10 +0200
Message-ID<AAbq1-4oG-1@gated-at.bofh.it>
In reply to#225856
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>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web