On 13.1. 14:37, Andreas Schwab wrote:
On Jan 13 2019, Robert Elz <k...@munnari.oz.au> 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.

  $ touch .foo aa.foo; bash -O extglob -c 'echo ?(aa).foo'
  aa.foo .foo


The change in Bash 5.0 also makes @(aa|) different from ?(aa) , even though the distinction between those two doesn't appear immediately obvious.


--
Ilkka Virta / itvi...@iki.fi

Reply via email to