[Top][All Lists]

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

extglob patterns and dotfiles

From: Eric Cook
Subject: extglob patterns and dotfiles
Date: Fri, 29 Dec 2017 18:55:35 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

When using an pattern that begin with an period in pattern-list, bash will 
include dotfiles in the results.
This doesn't seem to be the case with the various korn shells that i have seen. 
Since extglob is based on
ksh's extension to globbing, this appears to be an bug.

$ shopt -s extglob; touch .c
$ echo !(.a|.b)
. .. .c
$ ksh
$ echo !(.a|.b)
$ mksh
$ echo !(.a|.b)

When !(...) is prefixed with an period, ksh93 will match ., .. and .c while 
mksh matches .c
i would expect bash to match ., .. and .c to be consistent with how .* behaves 
currently in bash.

reply via email to

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