Deutsch   English   Français   Italiano  
<vn117q$faa$2@reader2.panix.com>

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

Path: ...!eternal-september.org!feeder3.eternal-september.org!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cross@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.unix.shell
Subject: Re: Default PATH setting - reduce to something more sensible?
Date: Fri, 24 Jan 2025 21:38:02 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <vn117q$faa$2@reader2.panix.com>
References: <vm5dei$2c7to$1@dont-email.me> <vmvp3d$2671i$1@dont-email.me> <vn04r2$ma8$1@reader2.panix.com> <vn0cno$29vrs$1@dont-email.me>
Injection-Date: Fri, 24 Jan 2025 21:38:02 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
	logging-data="15690"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)
Bytes: 2732
Lines: 46

In article <vn0cno$29vrs$1@dont-email.me>,
Janis Papanagnou  <janis_papanagnou+ng@hotmail.com> wrote:
>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?)

Because you might want to put whatever you assign to `PATH`
in quotes, for instance if their are spaces in one of the
component pathnames (people run `bash` on windows and all
kinds of weird places) and the behavior differs.  $HOME is
pleasantly boring by comparison.

>[snip]
>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_.

What if the expression refers to a file name with a space in
it?  Of course, one can escape the whitespace characters in
filenames, but that gets tedious.

>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.

See above.

	- Dan C.