Sujet : Re: Default PATH setting - reduce to something more sensible?
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.unix.shellDate : 22. Jan 2025, 21:15:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250122120930.74@kylheku.com>
References : 1 2 3 4 5 6
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-01-22, Geoff Clare <
geoff@clare.See-My-Signature.invalid> wrote:
Axel Reichert wrote:
>
tilde expansion is not, AFAIK, included in POSIX
>
Incorrect. See XCU 2.6.1 Tilde Expansion, which includes the following:
>
In an assignment (see XBD Section 4.26), multiple tilde-prefixes
can be used: one at the beginning of the word (that is, following
the <equals-sign> of the assignment), or one following any unquoted
<colon>, or both.
>
The reason this is there is for things like PATH=~/bin:~/sbin:/bin:...
But surely that must be expanded before PATH is assigned.
PATH is processed by the "p" exec functions like execlp. I don't
think these perform tilde expansion!
So the reason for using tilde in PATH assignments is the same reason
as using them in any other shell programming situation; to save
keystrokes over typing $HOME.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca