On 1/13/19 8:45 AM, Ilkka Virta wrote:
> On 13.1. 14:37, Andreas Schwab wrote:
>> On Jan 13 2019, Robert Elz <[email protected]> wrote:
>>
>>> The pattern
>>> ./$null"$dir"/
>>>
>>> is expanded (parameter expansion) to
>>>
>>> ./@()./
>>>
>>> which does not have a "." immediately after the / and
>>> tus cannot match any filename (incoludeing ".") which
>>> starts with a '.' character.
>>
>> For the same reason `*.' doesn't match `.'. Making `@()' work differently
>> from `*' would be surprising.
>
> However, ?(aa).foo matches the file .foo in Bash 4.4 and 5.0 (and also
> in Ksh and Zsh), so extglob already breaks the above mentioned rule.
Yes. That was part of the overhaul of this code that I referred to in
my first reply. I found that in ksh93 the extglob operators *(...) and
?(...) will match the leading dot, so I implemented it that way for
compatibility.
> The change in Bash 5.0 also makes @(aa|) different from ?(aa) , even
> though the distinction between those two doesn't appear immediately obvious.
My guess is the difference between those two operators in ksh93 is that
the @ has to match one of the patterns where the ? can match 0 occurrences.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/