Deutsch   English   Français   Italiano  
<871pwwwtee.fsf@axel-reichert.de>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Axel Reichert <mail@axel-reichert.de>
Newsgroups: comp.unix.shell
Subject: Re: Default PATH setting - reduce to something more sensible?
Date: Tue, 21 Jan 2025 07:52:25 +0100
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <871pwwwtee.fsf@axel-reichert.de>
References: <vm5dei$2c7to$1@dont-email.me> <vm5qc7$ft9$1@reader2.panix.com>
	<vml04v$2ugq2$1@dont-email.me> <vml2ho$30d8f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Tue, 21 Jan 2025 07:52:26 +0100 (CET)
Injection-Info: dont-email.me; posting-host="1694ad3f56743d235830009e53cc603d";
	logging-data="4058746"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+c3k41qrpqXYsMCOv5r6HW5/ihENvqO+g="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:mHlhWOLy8ZvzjTVJq3ZXtNHc9VE=
	sha1:ri0AqIZnoYetMo9K3Tadv28S0lA=
Bytes: 2437

Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

> On 20.01.2025 09:05, Wayne wrote:
>> 
>> As for non-sudo PATH, you can always run:
>>     export PATH=$(getconf PATH)
>> To get a minimal PATH setting guaranteed to include all POSIX
>> utilities.
>
> Yes, this comes very close to what I was actually aiming at. In
> my environment that's just /bin and /usr/bin and this is what I
> typically need in my scripts (plus sometimes /usr/local/bin).

I am a late-comer to an interesting thread ...

I think that, depending on your Linux distribution, /bin and /sbin are
symbolic links to their respective /usr counterparts (in Debian there is
a "usrmerge" package to help with this transition). Also, depending on
the adherence to file hierarchy standards, there are different policies
when it comes to /opt and /usr/local (the latter here has no files, only
empty directories).

So a tidy minimalist might opt for /bin only (plus, if needed,
$HOME/bin, which is better than ~/bin, because tilde expansion is not,
AFAIK, included in POSIX) as non-root and /bin:/sbin else.

> But all the sbin directories (and other clutter) would be gone. It
> practically shows that these directories are unnecessary for a normal
> (non-root) user.

Well, /usr/games is populated here ...   (-:

Best regards

Axel