On Mon, Oct 11, 2010 at 02:56:50PM +0200, Sven Mascheck wrote: > > If there is an absolute requirement to put *all* the files on a single > > command, "-exec +" may fail to satisfy it. It might break up the files > > into groups. > > Yes, but the same limit (ARG_MAX) gets hit, as soon as you call an external > command, like "vi "${arr...@]}" in the example above.
"-exec +" may break things into groups that are smaller than ARG_MAX. There's no guarantee how big the groups are. Also, if you truly must have them all in one invocation, it may be better to fail and get a nice friendly error, than to have the command run with only a subset of the files. This is where obfuscation of examples (e.g. replacing whatever-it-is with 'vi' or 'ls') causes issues.