On 1/25/21 4:36 PM, gregrwm wrote:
Bash Version: 5.0
Patch Level: 17
Release Status: release
Description:
. and .. are excluded from @(?|.?) in
bash 4.2.46(2)-release (CentOS 7.8), but are included in
bash 4.4.19(1)-release (CentOS 8.2) and
bash 5.0.17(1)-release (Ubuntu 20.04/focal).
is this change in functionality a regression, a "fix", or a new
feature?
is there any option to exclude them?
We're talking about behavior that changed around ten years ago, so there's
probably no going back.
in all 3, .. is included in .?
Yes, basically every shell except mksh does this. The leading dot is
matched explicitly.
so oddly in centos7 .. is included in .? but excluded from @(?|.?)
CentOS is using a version of bash that's over ten years old.
and in the more recent versions it's a different inconsistency, .
is excluded from ? ?? but included in @(?|.?)
That's the real question: whether or not `.' should match @(?|.?), even
when dotglob is enabled (and yes, both patterns have to be in there). There
isn't really any other. Since it doesn't match ? when dotglob is enabled,
there's an obvious inconsistency there, and that's what I'll look at.
but that's a bit askew from what actually interests me. if i had
my druthers, there would be an option to set so . and .. would never match
any (sub)glob other than their literal selves (even with dotglob set).
As Kerin Millar said, you can use GLOBIGNORE for this.
--
``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/