On 5/25/21 8:58 PM, Nora Platiel wrote:

Bash Version: 5.1
Patch Level: 8
Release Status: release

Hello,

Repeat-By:
$ shopt -s dotglob extglob
$ echo !(.foo)
. .. .other files

The doc says: "The filenames '.' and '..' must always be matched explicitly, even if 
dotglob is set."

When dotglob is enabled, the shell's pattern matcher interprets an extglob
pattern beginning with a literal `.' as specifying that files beginning
with a `.' should match, so the negated pattern matches `.' and `..'.

Also the pattern !(.foo) didn't match . and .. before version 4.3.0.

This is behavior that changed more than ten years ago.

There was a relevant discussion back in January:

https://lists.gnu.org/archive/html/bug-bash/2021-01/msg00240.html

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

Reply via email to