Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
From: "Gerrit P. Haase" <gp@familiehaase.de>
Organization: Esse keine toten Tiere
To: CROWLEY CAL <crowleyc@home.com>
Date: Tue, 18 Sep 2001 13:17:58 +0200
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Subject: Re: grep -r : permission denied
Reply-to: gp@familiehaase.de
CC: cygwin@cygwin.com
Message-ID: <3BA74986.27704.280BC6C8@localhost>
In-reply-to: <3BA6DA61.A4AF16A@home.com>
X-mailer: Pegasus Mail for Win32 (v3.12cDE)
X-Hops: 1
X-Sender: 320081107336-0001@t-dialin.net

CROWLEY CAL schrieb am 2001-09-17, 22:23:

>
>"Gerrit P. Haase" wrote:
>
>> 
>> I have a little wrapper for recursive greps. Call it 'rgrep' and
>> save it to /bin. Now you should be able to call:
>> 
>> $ rgrep SaerchTerm
>> 
>> rgrep:
>> ======
>> #!/usr/bin/sh
>> # grep $@ recursive
>> find . -type f -exec grep $@ {} /dev/null \;
>                 ^^^^^^^^^^^^^
>this will fork/exec for each filename the find generates.
>it is much more efficient to use xargs like this:
>  find . -type f -print | xargs grep $@
>which uses xargs to bundle up as many files as possible
>to pass to grep w/o overflowing the command-line buffer.
>(at least this is so on every UNIX system I have worked
>on in the past 14 years -- hope this is still true with
>Cygwin as well ;-).

Good point.  This works about 100 times faster:)

Gerrit


-- 
=^..^=

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

