|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, "" <firstname.lastname@example.org> <email@example.com> wrote:On 25/01/2021 21:36, gregrwm wrote: is this change in functionality a regression, a "fix", or a new feature? 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. https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html vq
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
|[Prev in Thread]||Current Thread||[Next in Thread]|