gnu grep in windows



I'm using the gnu grep utility (as ported from the latest - version 2.5.2 I
believe). With its -r switch, it has a limited recursive ability. However,
I've found that any filename pattern matching is case sensitive, which in
windows, it should not be. Does anyone know how to override this, or maybe
can point me to a grep that is fully gnu-compatible, with all of its latest
fixes and everything, while also fixing this filename case sensitivity
issue? Any help would be appreciated.

Here is a thread I had started in the gnu.utils.help/bug forum, which
eventually pointed me to windows-related groups.

"Mickey Ferguson" <ReneeMickey.Ferguson@xxxxxxxxxxx> wrote in message
news:mailman.7839.1203820601.18990.bug-gnu-utils@xxxxxxxxxx
Bob, thanks for the help. You are right about the missing directory
argument. I missed that earlier. By supplying ".", it eliminated the
'Not enough space' error. I finally got it to the point where I got it
mostly working, but I discovered one thing about the port that may be good
for the unix environment, but doesn't work for Windows: The filename
pattern matching is case sensitive. In other words, if I had a file named
"MyFile.txt" and I searched for "my*.txt" (without the quotes in both
cases), it would fail to find it, while if I searched for "My*.txt" it
would find it. I understand that in the unix world filenames are
case-sensitive, but in the Windows world they are not. Thus, file pattern
matching should not be case-sensitive for the Windows implementation.

"Bob Proulx" <bob@xxxxxxxxxx> wrote in message
news:mailman.7817.1203760771.18990.help-gnu-utils@xxxxxxxxxx
Mickey Ferguson wrote:
My problem is that it just doesn't work for me. (I'm using XP SP2.)
When I use the -r switch, I get a 'Not enough space' error.

That does seem strange.

->grep -rl --include=*.ini Change
grep: (standard input): Not enough space

First things first. You are missing a directory argument in which to
recurse. Because grep does not have any file/directory arguments to
process it defaults to reading standard input. Using -r does not make
sense with regards to standard input.

Fix this first by giving grep a directory to recurse into. When using
the -r option it is typical to use the '.' directory. Try this:

grep -rl --include=*.ini Change .

I've created an alias in my command processor (4nt) language, that

The typical way to do this would be to use 'find'.

find . -name "*.ini" -exec grep -l Change {} +

The {} is replaced by find with a maximum list of filenames and the
'+' terminates the command.

... This works fine, but I'd rather figure out what I'm doing wrong
above with the -r switch.

Admirable. Looks like it is a bug in the port to me. It doesn't give
that error in GNU grep's native GNU environment. But your results
sound as if the code is trying to recurse on stdin and failing. That
should be reported to the Cygwin folks.

Bob


.



Relevant Pages

  • Re: Transferring directory structure to Windows
    ... Transferring directory structure to Windows ... Filename collisions are a real threat but it should be ... whether FTP, tar, or whatever, you will only wind up ...
    (AIX-L)
  • Re: Characters allowed in short filenames
    ... fatgen103.doc seems to have a slightly below average proportion of bugs, but Windows doesn't completely agree with it. ... > My partial understanding is that short filenames are stored using the> OEM ... > As far as I can tell, code page 437 doesn't contain a ß character. ... > page is 850 then we are halfway towards allowing a short filename to ...
    (microsoft.public.development.device.drivers)
  • Re: Reading Text Files
    ... those questions that has far more to do with Windows than it has ... If the string doesn't represent such a filename, ... Consider, for example, MVS, in which filenames consist of digits, ... but *only* in the context of a PDS. ...
    (comp.lang.c)
  • Media Centre Crashes on opening (Vista)
    ... I have windows vista ultimate. ... at MediaCenter.Store.SqlLite.ObjectStoreOpener.Open(String fileName) ... at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Objectparameters, CultureInfo culture, Boolean skipVisibilityChecks) ...
    (microsoft.public.windows.mediacenter)
  • Re: Characters allowed in short filenames
    ... fatgen103.doc is very clear in prohibiting lower-case letters from being stored in a short name. ... US Windows would be 437, ... the current default OEM code page is 437 and I create a new file then the ... page is 850 then we are halfway towards allowing a short filename to contain ...
    (microsoft.public.development.device.drivers)