This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: grep -r : permission denied
- To: CROWLEY CAL <crowleyc at home dot com>
- Subject: Re: grep -r : permission denied
- From: "Gerrit P. Haase" <gp at familiehaase dot de>
- Date: Tue, 18 Sep 2001 13:17:58 +0200
- CC: cygwin at cygwin dot com
- Organization: Esse keine toten Tiere
- Reply-to: gp at familiehaase dot de
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/