Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Script to delete huge sparsebundle images' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Script to delete huge sparsebundle images
Authored by: richard2 on Jul 19, '12 10:04:34AM

You can simplify

find Path -print0 | xargs -0 Command

to

find Path -exec Command {} +

find's documentation describes this syntax as follows:

-exec utility [argument ] {} +
Same as -exec, except that "{}" is replaced with as many pathnames as possible for each invocation of utility. This behaviour is similar to that of xargs(1).

Edited on Jul 19, '12 10:11:53AM by richard2


[ Reply to This | # ]
Script to delete huge sparsebundle images
Authored by: fracai on Jul 19, '12 10:16:34AM

Yeah, I've always preferred piping to xargs though. I think it's the requirement to use brackets to insert the arguments and the cryptic, required terminator '+' or ';'.

And if you need to have arguments after the found files, you can always use the -I (or -J?) flags to specify an insertion character.

To each their own.

---
i am jack's amusing sig file
Edited on Jul 19, '12 10:18:50AM by fracai



[ Reply to This | # ]
Script to delete huge sparsebundle images
Authored by: wjv on Jul 26, '12 05:34:59AM
xargs is preferable as it would result in vastly fewer invocations of Command.

[ Reply to This | # ]