[Top][All Lists]

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

Re: . and .. are included where they were excluded before

Subject: Re: . and .. are included where they were excluded before
Date: Tue, 26 Jan 2021 15:56:10 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.6.1

On 26/01/2021 13:04, Lawrence Velázquez wrote:
On Jan 26, 2021, at 12:51 AM, "" <kfm@plushkava.net> <kfm@plushkava.net> wrote:

On 25/01/2021 21:36, gregrwm wrote:

         is this change in functionality a regression, a "fix", or a new
         is there any option to exclude them?
         in all 3, .. is included in .?

This seems to be as expected. The pattern must begin with a literal dot in 
order to match either of the pathnames '.' and '..'. This holds true, 
irrespective of whether or not dotglob is enabled.

Ergo, a pattern of ? should not match the pathname '.', whereas a pattern of .? 
can - and will - match the pathname '..'. Similarly, a pattern of .* would 
match both '.' and '..'.

According to the manual, "[t]he filenames ‘.’ and ‘..’ must always be
matched explicitly even if dotglob is set." I don't see any subsequent
text that overrules this for extended globs.



Indeed, nor should you. I would summarise the implications of the report as follows.

Firstly, ? should never match '.' because of the constraint described by the sentence preceding the one you quoted. Secondly, the matter of whether a given pattern is contained by a @(pattern-list) should not influence the behaviour of said pattern. In particular, @(?|.?) should never ignore '..', owing to the presence of the .? pattern which explictly matches.

The OP has indicated that these two assurances do not collectively hold for the systems on which he is testing (they do for all the systems that I have). Therein lies the rub.

Kerin Millar

reply via email to

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