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: Ilkka Virta
Subject: Re: Difference of extglob between 5.0.0(1)-release and 4.4.23(1)-release
Date: Sun, 13 Jan 2019 15:45:38 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 13.1. 14:37, Andreas Schwab wrote:
On Jan 13 2019, Robert Elz <kre@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 / itvirta@iki.fi



reply via email to

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