Hush script to recurse through file system?

Harald Becker ralda at gmx.de
Sun Jun 19 20:34:56 UTC 2011


 Hallo Christopher!

> I've mostly used -exec because I just thought it was better in all cases - clearly it's
> not.

FYI: I like to use -exec too ... but efficiency depends on several
issues. Every program invocation involves some system overhead. Reducing
the number of program invocations may speed up the hole process if that
system overhead is high or the program gets called very often. On the
other hand is the possibility of the pipe solution for a bigger memory
usage peak relatively high. It needs buffers for the pipe, space for
xargs, extra space for the command line arguments and may result in much
more memory consumption of the called program. So if you are low on
memory the "-exec" variant with multiple invocations may be faster then
the pipe variant (avoiding extra swaps). Hence it highly depends on the
concrete usage scenario which variant is the "better" one.

Just to be correct and to avoid pointing novices in a wrong direction.

--
Harald


More information about the busybox mailing list