Date: Wed, 16 Jun 1999 01:08:41 +0100 From: Ben Smithurst <ben@scientia.demon.co.uk> To: chris <chris@ns1.aepnet.com> Cc: kip@lyris.com, freebsd-stable@FreeBSD.ORG Subject: Re: open files Message-ID: <19990616010841.A9255@rainbow5.scientia.demon.co.uk> In-Reply-To: <Pine.LNX.4.04.9906151537340.20513-100000@ns1.aepnet.com> References: <19990615215254.A8122@rainbow5.scientia.demon.co.uk> <Pine.LNX.4.04.9906151537340.20513-100000@ns1.aepnet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
chris wrote:
> why? I was always fond of stuff like:
> vi `find /usr/src/sys -exec grep -l "SYSCTL.*maxfiles" \{\} \;`
That will fork a grep program for every file under /usr/src/sys, (about
4,500), which is not exactly the height of efficiency. xargs packs as
many filenames as will fit and run grep on all of them. (I think the
limit is 64k characters for all the arguments combined, which means only
three grep processes are needed, if you do `cd /usr/src/sys; find .
-stuff' only two greps are needed, but that gain really isn't worth it.)
As a comparison,
`find /usr/src/sys | xargs /bin/echo' took 0.3 seconds.
`find /usr/src/sys -exec /bin/echo {} \;' took 22 seconds.
that's a big enough saving for me.
At least you got one thing right though: you didn't mention emacs at
least. :-)
--
Ben Smithurst | PGP: 0x99392F7D
ben@scientia.demon.co.uk | key available from keyservers and
| ben+pgp@scientia.demon.co.uk
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990616010841.A9255>
