bug-grep
[Top][All Lists]
Advanced

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

Re: Grep --include does not work


From: Bob Proulx
Subject: Re: Grep --include does not work
Date: Fri, 8 Jun 2007 12:47:53 -0600
User-agent: Mutt/1.5.9i

LeonM wrote:
> I have downloaded from
> http://gnuwin32.sourceforge.net/packages/grep.htm

If this is a MS-Windows binary then you need to know that it is a port
of the GNU program and is operating in a mode where behavior is
"mapped" to the MS world.  In particular file globs behave
differently.  There is only so much adaption that can be done and then
the MS world creeps in regardless.  :-(

> the version 2.5.1a and it works according to my reading of the
> documentation. This
> grep -R --include="*.txt" -P include *
> 
> works but the version 2.5.1a-1 fails to work correctly.

Just the same, use a '.' instead of '*'.  The '*' is not the best
usage because of file glob expansion.

> So it seems there is either an inconsistent interpretation of the
> combination of switches or some programming logic rendering two
> distinct behaviors. Either reason it is wrong right?

This won't be in the upstream.  In the GNU world the command line
shell does the file glob expansion not the command.  In the MS world
that is done by a library or something that links in with the program
and is therefore part of the command.  Because of this it is
completely different.

If you are concerned about using '*' instead of '.' and the difference
in the '*' case is important then your best option is to report this
to the gnuwin32 people.

Bob




reply via email to

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