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


Groups > comp.unix.programmer > #16942

Re: Default PATH setting - reduce to something more sensible?

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 2025-01-15 23:26 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <vm9g7r$ish$1@reader2.panix.com> (permalink)
References <vm5dei$2c7to$1@dont-email.me> <rRQhP.65293$XfF8.23235@fx04.iad> <8734hjga0n.fsf@doppelsaurus.mobileactivedefense.com> <vm9err$35gfs$1@dont-email.me>

Cross-posted to 2 groups.

Followups directed to: comp.unix.shell

Show all headers | View raw


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.

Back to comp.unix.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Default PATH setting - reduce to something more sensible? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-14 11:14 +0100
  Re: Default PATH setting - reduce to something more sensible? cross@spitfire.i.gajendra.net (Dan Cross) - 2025-01-14 13:55 +0000
  Re: Default PATH setting - reduce to something more sensible? Rainer Weikusat <rweikusat@talktalk.net> - 2025-01-14 17:16 +0000
    Re: Default PATH setting - reduce to something more sensible? scott@slp53.sl.home (Scott Lurndal) - 2025-01-14 17:22 +0000
      Re: Default PATH setting - reduce to something more sensible? Kaz Kylheku <643-408-1753@kylheku.com> - 2025-01-14 17:59 +0000
      Re: Default PATH setting - reduce to something more sensible? Rainer Weikusat <rweikusat@talktalk.net> - 2025-01-14 19:23 +0000
        Re: Default PATH setting - reduce to something more sensible? scott@slp53.sl.home (Scott Lurndal) - 2025-01-14 22:17 +0000
          Re: Default PATH setting - reduce to something more sensible? cross@spitfire.i.gajendra.net (Dan Cross) - 2025-01-14 23:24 +0000
          Re: Default PATH setting - reduce to something more sensible? Rainer Weikusat <rweikusat@talktalk.net> - 2025-01-15 15:38 +0000
            Re: Default PATH setting - reduce to something more sensible? scott@slp53.sl.home (Scott Lurndal) - 2025-01-15 15:52 +0000
              Re: Default PATH setting - reduce to something more sensible? Rainer Weikusat <rweikusat@talktalk.net> - 2025-01-15 19:19 +0000
                Re: Default PATH setting - reduce to something more sensible? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-16 00:03 +0100
                Re: Default PATH setting - reduce to something more sensible? scott@slp53.sl.home (Scott Lurndal) - 2025-01-15 23:14 +0000
                Re: Default PATH setting - reduce to something more sensible? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-19 13:50 +0100
                Re: Default PATH setting - reduce to something more sensible? cross@spitfire.i.gajendra.net (Dan Cross) - 2025-01-15 23:26 +0000
                Re: Default PATH setting - reduce to something more sensible? Rainer Weikusat <rweikusat@talktalk.net> - 2025-01-16 11:51 +0000
                Re: Default PATH setting - reduce to something more sensible? Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-01-19 14:10 +0100
                Re: Default PATH setting - reduce to something more sensible? Rainer Weikusat <rweikusat@talktalk.net> - 2025-01-19 20:36 +0000
                Re: Default PATH setting - reduce to something more sensible? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-01-19 15:55 -0800
                Re: Default PATH setting - reduce to something more sensible? antispam@fricas.org (Waldek Hebisch) - 2025-01-16 17:01 +0000
                Re: Default PATH setting - reduce to something more sensible? Rainer Weikusat <rweikusat@talktalk.net> - 2025-01-16 19:07 +0000

csiph-web