Re: grep question


Subject: Re: grep question
From: Gary Johnson (gjohnson@agilent.com)
Date: Sun Feb 27 2000 - 18:08:39 CST


On Sun, Feb 27, 2000 at 04:51:06PM +0000, Matthew Kirkwood wrote:

> find . -name *.bar -print0 | xargs -0 grep bing.*bong /dev/null
>
> will bemarginally quicker, as it will only fire off one grep process
> for every 20 files (I think that's the default). And you'll see the
> filename on the same line as the text, which is much nicer :)

Also, you should quote any wild cards in the -name argument to prevent
the shell from expanding that argument before passing it to find, e.g.,

    find . -name \*.bar -print0 | xargs -0 grep bing.*bong /dev/null

-- 
Gary Johnson                 | Agilent Technologies
gjohnson@agilent.com         | RF Communications Product Generation Unit
                             | Spokane, Washington, USA



This archive was generated by hypermail 2b25 : Sun Feb 27 2000 - 18:08:42 CST