Subject: Re: grep options (Was: groff-1.16.1 reach-over)
To: None <tech-userlevel@netbsd.org>
From: Lucio De Re <lucio@proxima.alt.za>
List: tech-userlevel
Date: 04/18/2001 06:15:49
On Tue, Apr 17, 2001 at 08:15:48PM -0400, John Hawkinson wrote:
>
> | of course, you can always do this:
> |
> | # cd /usr/src
> | # find . -name Makefile | xargs grep ^.PATH | grep cksum
>
> You should never use xargs like that, because it might call
> grep with only one argument in which case a filename would not be
> printened. Instead, use
>
> find . -name Makefile | xargs grep ^.PATH /dev/null | grep cksum
> ^^^^^^^^^
I use ``grep -Hl ...'' to identify just the files involved. other
versions of grep (notably, Plan 9's) seem not to have the H option,
and I've been toying with just the idea of using -vL for the
equivalent effect, but have yet to try it.
++L