Deutsch English Français Italiano |
<vm9g7r$ish$1@reader2.panix.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.misty.com!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail From: cross@spitfire.i.gajendra.net (Dan Cross) Newsgroups: comp.unix.programmer,comp.unix.shell Subject: Re: Default PATH setting - reduce to something more sensible? Followup-To: comp.unix.shell Date: Wed, 15 Jan 2025 23:26:51 -0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Message-ID: <vm9g7r$ish$1@reader2.panix.com> References: <vm5dei$2c7to$1@dont-email.me> <rRQhP.65293$XfF8.23235@fx04.iad> <8734hjga0n.fsf@doppelsaurus.mobileactivedefense.com> <vm9err$35gfs$1@dont-email.me> Injection-Date: Wed, 15 Jan 2025 23:26:51 -0000 (UTC) Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80"; logging-data="19345"; mail-complaints-to="abuse@panix.com" X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: cross@spitfire.i.gajendra.net (Dan Cross) Bytes: 2923 Lines: 44 In article <vm9err$35gfs$1@dont-email.me>, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote: >[snip] >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?" Not particularly. The system has, probably for no really principled reason, evolved over time such that that's simply the set of things that are in $PATH by default on that particular machine. Another machine might be different. If I had to hazard a guess, I imagine some of it comes from the folks who put together the distribution, some upgrades, and the choices of e.g. the window manager you're using (recalling that at least one $PATH component appeared to come from that). > "_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." There are many ways you could do this. Probably the easiest is just to explicitly set $PATH in your shell's startup files to those directories you care about; that's what I usually do. If you make a mistake with it, you won't affect the rest of the system. If you want to set it globally for all users, there's likely some file in /etc or similar that sets the defaults; on my Linux machine I see a number of things in /etc/profile and /etc/profile.d/* that seem relevant and there's /etc/login.defs; PAM has its own way to set up $PATH. I'm not sure I'd bother, though, if setting it up for your own account is sufficient. - Dan C.