On 1/23/25 6:37 PM, Keith Thompson wrote:

Bash Version: 5.2
Patch Level: 32
Release Status: release

Description:
     A literal '~' or other tilde-prefix at the beginning of an
     element of $PATH is expanded when a command is executed
     from the bash prompt.  This is undocumented and inconsistent with
     the behavior of other commands that can execute commands.

Yes, bash has always done this, from its earliest days. It's not a great
idea, it was never documented, it's deprecated, and its use is not
encouraged.

     This expansion doesn't happen when bash is invoked as "/bin/sh"
     (which is a symlink to bash on some systems).

POSIX clearly disallows it, so it's not enabled in posix mode (it predates
posix mode by years). By the time posix mode came along, backwards
compatibility was already an issue.

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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to