Sujet : Re: Default PATH setting - reduce to something more sensible?
De : antispam (at) *nospam* fricas.org (Waldek Hebisch)
Groupes : comp.unix.programmerDate : 16. Jan 2025, 18:01:59
Autres entêtes
Organisation : To protect and to server
Message-ID : <vmbe25$3v6su$4@paganini.bofh.team>
References : 1 2 3 4 5 6 7 8 9
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> wrote:
On 15.01.2025 20:19, Rainer Weikusat wrote:
scott@slp53.sl.home (Scott Lurndal) writes:
Rainer Weikusat <rweikusat@talktalk.net> writes:
scott@slp53.sl.home (Scott Lurndal) writes:
Rainer Weikusat <rweikusat@talktalk.net> writes:
scott@slp53.sl.home (Scott Lurndal) writes:
Rainer Weikusat <rweikusat@talktalk.net> writes:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
[...]
The PDP-11 can be rationally compared with the situation of the OP,
namely, doing local filesystem operations on a single computer. [...]
Since you're referring to me, the OP, please note that most arguments
here have quickly made a relation to a straw man (a performance theme)
or made other deviations from the basic question(s) that concerned me.
Essentially there were two questions I had that I can reformulate in a
more compact form as
"Why, in the first place, are all these path components
part of the default PATH for ordinary users? - Is there
any [functional] rationale or necessity for that?"
On my Debian system PATH is:
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
'/bin' is a symlink to '/usr/bin', so AFAICS '/bin' could be
safely removed from the path. '/usr/local/games' and
'/usr/games' are empty and I do not intend to put anything
there, so they could be removed too. I have programs in
'/usr/local/bin' so for me minimal PATH could be
/usr/local/bin:/usr/bin
Note: On Debian when as a normal user I need something from
'/sbin' I use full pathname. That is purely matter of
convenience.
Note2: Some programs depend on specific PATH settings. IMO
it is responsibility of the program to ensure proper PATH.
In particular "main" program invoked by users may be a shell
scripts which sets up needed environment variables (including
PATH) and then execs acutal program.
"_If_ many of the default PATH components are unnecessary,
where and how to best reduce these settings to a sensible
subset? - Without spoiling the system, of course."
Arguably, as long as standard system utilities are in the
PATH, nothing should brake. That is if some programs wants
something extra in PATH this is a bug in the program or at best
inconvenient user interface.
-- Waldek Hebisch