bug-bash
[Top][All Lists]
Advanced

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

Re: Difference of extglob between 5.0.0(1)-release and 4.4.23(1)-release


From: Chet Ramey
Subject: Re: Difference of extglob between 5.0.0(1)-release and 4.4.23(1)-release
Date: Sat, 12 Jan 2019 17:12:12 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.3.3

On 1/12/19 12:17 AM, Peng Yu wrote:
> See the following for the difference. I'd consider the behavior of
> 4.4.23 should be correct.

The bash-4.4 code only worked the way you want it by chance. There was a
bug that was fixed in January, 2017, the result of

http://lists.gnu.org/archive/html/bug-bash/2017-01/msg00018.html

that uncovered the behavior you're complaining about.

I am not sure of your characterization of the bash-4.4 behavior as correct.
In a filename context, or a context where a leading `.' must be matched
explicitly, a pattern must only match a filename that starts with a `.' if
`.' is the first character in the pattern. A pattern that begins with a
null extglob pattern (especially one that is defined to perform at least
one match) followed by a dot, quoted or unquoted, does not fulfill that
criterion.

> 
> How was this bug introduced? Should there be a test case to cover this case?

I wouldn't be so quick to declare this a bug. Other shells (e.g, ksh93,
mksh, and zsh) that implement extended globbing patterns behave like
bash-5.0 does.

There is a question of whether or not an extglob pattern that is allowed
to make zero matches followed by a `.' should succeed, and the existing
implementations are mixed on that point.

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



reply via email to

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