Code: Select all
$ echo $PATH
.:.:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin
Code: Select all
$ echo $PATH
.:.:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin
OK, that's the micro$oft way, too __{{emoticon}}__ The issue with cwd in path is somthing (malware...) could easily induce one to execute a malicious replacement for a legitimate command. Well, I guess malware is less a problem on antiX than in Windows (and I've never been"infected" running Windows, either). Thanks for the hint, Skidoo - I am going to leave the dot where it belongs and to ignore the double (triple, even, in a rxvt I'ne just opened now) occurrence.As for"best practice", shrug. If you would prefer incessantly typing full filepaths, knock yerself out. On my systems, I welcome the presence of leading dot (cwd) in the path envvar.
Open the file /usr/local/lib/desktop-session/lib-desktop-session.sh in an editor and comment the line"PATH=.:$PATH" out.Ninho wrote:How would I most easily remove/repair the double occurrence of dot in PATH [...],
Well, I don't feel authorized to answer the second half of your question. But I have removed the double (in my case: triple) dots some hours ago and haven't observed any problems since.Ninho wrote:[...] and would the removing possibly break some built-in script, functionality or program ?
Thanks, rD ! I'll follow your lead, not expecting problems either.reverseDog wrote: comment the line"PATH=.:$PATH" out.
... I have removed the double (in my case: triple) dots some hours ago and haven't observed any problems since.
You've raised an excellent point. Considering all the other hoops I jump through trying to be safe, I realize that I really shouldn't"shrug".The issue with cwd in path is something (malware...)
could easily induce one to execute a malicious replacement for a legitimate command.
I encountered this (.:.:.:.:.:.:.:.:.:.:.:/usr/bin...) recently while using lxterminal.I'm seeing my $PATH in antiX (regular user account) starts in dot (current working directory). Even twice...
That quoted linuxDocumentationProject page mentions about 8 or 9 places along the way
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.tldp.org/HOWTO/text/Path"
linktext was:"http://www.tldp.org/HOWTO/text/Path"
====================================
sudo command has again a different approach to path handling.
It modifies the search path so that the current directory is always the last one.
However, it does not modify PATH environment variable.
Code: Select all
--preserve-env, -k
Preserve the current environments, does not set $HOME nor $PATH, for example.
--login, -l
Make this a login shell.
Since /usr/local/lib/desktop-session/lib-desktop-session.sh is responsible for adding the current working directory (.) to $PATH but doesn't get sourced by login shell, your solution works.skidoo wrote:Checking roxterm, I found the $PATH was not similarly affected.
Comparing prefs set for the 2 emulators, I noticed that"treat shell as login shell" was checkmarked in my roxterm prefs.
Same wasn't marked in lxterminal prefs, and when I did so, that resolved lxterminal's"weird" pathstring.
Code: Select all
export PATH=${PATH##+(.:)}