Sujet : Re: Default PATH setting - reduce to something more sensible?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shellDate : 24. Jan 2025, 16:48:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vn0cno$29vrs$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 24.01.2025 14:33, Dan Cross wrote:
In article <vmvp3d$2671i$1@dont-email.me>,
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
On 23.01.2025 23:46, Keith Thompson wrote:
[snip]
For this and other reasons, though you *can* have a literal ~ in $PATH
in bash, it's best to avoid it and use $HOME instead.
>
Or use it correctly, unquoted and unescaped.
Or just don't use it, and then you don't have to worry about it.
But as a Ksh (or any non-Bash shell) user I don't have
to worry about it. (Why shall I see any issue with it?)
(But as I very early already said; I anyway don't use
tilde-expressions in scripts, even as a Ksh user.)
But more importantly; shell programmers shall be well aware
of what quotes mean in shells! They are not just fancy things
or accessories that one may or may not use as one likes. They
have clear semantics and are essential in shell programming.
If you want tilde-expressions expanded _don't quote them_.
It's not much different from file-globbing; don't escape or
quote a '*' (or other globbing meta-characters) if you want
it to become expanded.
The suggestion to "not use" this ~ or that * is misguiding.
Know the shell concepts! - Or know your shell, at least,
with all its inconsistencies and/or (where applicable) bugs.
Janis