Bruce Woodward wrote:
Forking and exec'ing isn't effortless.
Never said it was, but why don't you try it again but this time make the
1000 files say a few hundred megabytes in size instead of zero bytes.
Unix System V file accesses were asynchronous, this could be seen when
you wrote to a floppy. For example
$ rm /mnt/floppy/*
would return to the $ prompt after only a second or so, but then when
you did
$ sync; sync; umount /dev/dsk/floppy
you'd be waiting ages whilst the disk was erased. If that is still the
case in Linux the forking and exec'ing will occur in parallel to the
disk activity and will finish inside that time window so from a
practical point of view that one second saved isn't worth a whole lot.
(and given that I've now got a godzillion hz processor bored to tears
out of it's silicon picking head, who cares!)
Incidently the last time the -exec vs xargs came up the -exec script
given worked, the xargs didn't. Then when this was pointed out the reply
was "well it was only an example" I.E a polite way of saying go RTFM.
For my money, I'll take the slower simpler but working example every time.
P.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html