O' darn it! Use "find ... -print0 | xargs -0 ..." construct already!
In particular (slightly formatted) ...
find -- walk a file hierarchy . . . -print0 This primary always evaluates to true. It prints the pathname of the current file to standard output, followed by an ASCII NUL character (character code 0). xargs -- construct argument list(s) and execute utility . . . -0 Change xargs to expect NUL (``\0'') characters as separators, instead of spaces and newlines. This is expected to be used in concert with the -print0 function in find(1).
Above construct may still fail, on behalf of xargs (see the bottom portion, just after options, of above linked man page), say, if there are "many enough" files. A search on Google Groups produced "maximum command line length <tcsh>".
In reply to Passing list long enough for shell expansion to fail, but not for "find | xargs" (was: Re: Writing unix-style filters)
by parv
in thread Writing unix-style filters
by njcodewarrior
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |