help-gnu-utils
[Top][All Lists]
Advanced

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

Re: grep -r doesn't work for me


From: Bob Proulx
Subject: Re: grep -r doesn't work for me
Date: Sat, 23 Feb 2008 02:59:25 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

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




reply via email to

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