GNU bug report logs - #58134
grep for windows Include GLOB pattern with double star doesn't seem to work

Previous Next

Package: grep;

Reported by: Alex Benoit <Alexandre.Benoit <at> microsoft.com>

Date: Wed, 28 Sep 2022 08:45:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Alex Benoit <Alexandre.Benoit <at> microsoft.com>
Subject: bug#58134: closed (Re: bug#58134: grep for windows Include GLOB
 pattern with double star doesn't seem to work)
Date: Wed, 28 Sep 2022 17:08:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#58134: grep for windows Include GLOB pattern with double star doesn't seem to work

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 58134 <at> debbugs.gnu.org.

-- 
58134: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58134
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Alex Benoit <Alexandre.Benoit <at> microsoft.com>
Cc: 58134-done <at> debbugs.gnu.org
Subject: Re: bug#58134: grep for windows Include GLOB pattern with double star
 doesn't seem to work
Date: Wed, 28 Sep 2022 10:07:27 -0700
On 9/27/22 16:19, Alex Benoit via Bug reports for GNU grep wrote:
> However, this worked:
> grep -rl --include="*.xml" foo .
> 
> Is the double star supported on Windows?

Yes and no. It's a POSIX glob, which means "**" is equivalent to "*", 
and that's what's supported. Whether it's MS-Windows shouldn't matter.


> What is the proper way to do it?

Looks like you found it already.

[Message part 3 (message/rfc822, inline)]
From: Alex Benoit <Alexandre.Benoit <at> microsoft.com>
To: "bug-grep <at> gnu.org" <bug-grep <at> gnu.org>
Subject: grep for windows Include GLOB pattern with double star doesn't seem
 to work
Date: Tue, 27 Sep 2022 23:19:42 +0000
[Message part 4 (text/plain, inline)]
Hello,

I was using grep for Windows version 3.5.

I was trying to pattern match files.

At first, I thought I could put a regex as the file pattern in the command, but that didn't seem to work.

Then I looked at the --include option.

I tried

grep -l --include="**/*.xml" foo .
grep -l --include="**\*.xml" foo .
grep -l --include="**\\*.xml" foo .

Adding the recursive -r didn't help either.

However, this worked:
grep -rl --include="*.xml" foo .

Is the double star supported on Windows? What is the proper way to do it?

All the best,

Alex
[Message part 5 (text/html, inline)]

This bug report was last modified 2 years and 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.