Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com From: "Gerrit P. Haase" Organization: Esse keine toten Tiere To: CROWLEY CAL 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 AT familiehaase DOT de CC: cygwin AT cygwin DOT 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 AT t-dialin DOT 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/