GNU bug report logs -
#14391
bug in grep -- ignoring GREP_OPTIONS or not acting on it...
Previous Next
Reported by: Linda Walsh <coreutils <at> tlinx.org>
Date: Sun, 12 May 2013 05:06:02 UTC
Severity: normal
Tags: notabug
Done: Pádraig Brady <P <at> draigBrady.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Bob Proulx wrote:
>
> Basically:
>
> I think you need --directories=skip in addition to --devices=skip.
> Add -d skip to your option list.
>
> grep -D skip -d skip --binary-files=without-match --color=auto foo *
>
> This is an example of why I think grep should never have added
> directory recursion. It needs to suck in all of 'find' before it will
> be complete. And that doesn't make sense because there is already
> find available.
>
> find . -type f -exec grep foo {} +
>
> That isn't precisely the same as the grep case you posted but it is
> usually what people want. For -D skip it would need to be more like
> this:
>
> find . -follow ! -type d -exec grep foo {} +
>
> If there were often used favorite options then I would turn them into
> either a shell script or a shell function.
----
Very good points -- especially about my broken options (I could swear they worked
in the past)...must have gotten accidently deleted somewhere along in the past.
But .. I also agree with the problems of grep possibly calling find
inefficiently. I would have thought it smarter to call find as a child, and
read from
it's pipe and call the file-search on large groups at a time. Otherwise, if grep
waited for all of find to complete, as you are suggesting, might it not run out
of space
to hold the paths of the files it is going to search?
This bug report was last modified 12 years and 14 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.