bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tilde is expanded in $PATH, inconsistent behavior


From: Chet Ramey
Subject: Re: Tilde is expanded in $PATH, inconsistent behavior
Date: Fri, 24 Jan 2025 11:45:22 -0500
User-agent: Mozilla Thunderbird

On 1/23/25 9:15 PM, Keith Thompson wrote:

But I don't see anything in the "Tilde Expansion" section that
documents the behavior of a literal '~' in $PATH.

It remains undocumented.


I suggest it would be better to document the behavior, since I imagine
it's fairly easy to run into it accidentally.  For example, something like

     PATH="~/bin:$PATH"

will trigger the behavior.

What do you think a user expects when they do something like this? How
many instances of this do you think exist out there? If you're going to
use something nonsensical like that, my guess is more people want the bash
behavior than not, as bad an idea as it is.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]