bug-bash
[Top][All Lists]
Advanced

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

Re: bash "extglob" needs to upgrade at least like zsh "kshglob"


From: Chet Ramey
Subject: Re: bash "extglob" needs to upgrade at least like zsh "kshglob"
Date: Thu, 17 Nov 2022 12:11:08 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 11/17/22 6:05 AM, Koichi Murase wrote:

Also, I have a suggestion of changes for more consistent handling of
incomplete bracket expressions.  Currently, incomplete bracket
expressions sometimes fail unconditionally (#26..#31) and sometimes
fall back to a literal `[' plus remaining pattern (#18..#25).  I
attach another patch for this:
[r0037.brackmatch5.incomplete-bracket.patch.txt].

"If a pattern ends with an unescaped <backslash>, it is unspecified whether
the pattern does not match anything or the pattern is treated as invalid."

Bash uses the former interpretation. If "the pattern is treated as invalid"
means trying to literally match the open bracket and going on from there,
your interpretation is valid as well. The standard doesn't use that
language in other places it specifies to treat the bracket as an ordinary
character to be matched literally, however.


--
``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/




reply via email to

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