From: Mike Castle <dalgoda@ix.netcom.com>
To: BobGian@U.Washington.edu
Cc: dalgoda@ix.netcom.com, linux-console@vger.kernel.org,
jeff.holle@verizon.net
Subject: Re: encapulating a find function in a script
Date: Fri, 16 Jan 2004 12:09:37 -0800 [thread overview]
Message-ID: <20040116200937.GL15245@thune.mrc-home.com> (raw)
In-Reply-To: <200401161953.i0GJrnb28511@trumpet.radonc.washington.edu>
On Fri, Jan 16, 2004 at 11:53:49AM -0800, BobGian@U.Washington.edu wrote:
> > You may also find that using xargs instead of -exec is much faster
> > (fewer fork/execs).
> >
> > Something like:
> >
> > find "$1" -name "$2" -print0 | xargs -0 grep -H "$3"
> >
> > mrc
> > --
>
> Thanks! Tried it - works great. Runs two or three times as fast
> and with half as many page faults.
Just remember that the -print0 and -0 are GNU extensions. If you work on
other OS's, you may need to look at going back to -exec, or see if they
offer any similar extensions.
mrc
--
Mike Castle dalgoda@ix.netcom.com www.netcom.com/~dalgoda/
We are all of us living in the shadow of Manhattan. -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc
next prev parent reply other threads:[~2004-01-16 20:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-16 19:53 encapulating a find function in a script BobGian
2004-01-16 20:09 ` Mike Castle [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-01-15 0:34 BobGian
2004-01-15 1:00 ` Mike Castle
2004-01-15 1:55 ` Jeffrey Holle
2004-01-16 21:09 ` Jeffrey Holle
2004-01-15 0:19 Jeffrey Holle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040116200937.GL15245@thune.mrc-home.com \
--to=dalgoda@ix.netcom.com \
--cc=BobGian@U.Washington.edu \
--cc=jeff.holle@verizon.net \
--cc=linux-console@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).