Liste des Groupes | Revenir à cu shell |
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.
Les messages affichés proviennent d'usenet.