A couple of WARNINGS about doing things this way.
1. Most likely, some of the found files will contain blanks within the filename or path. Those blanks cause confusion to xarg's blank-based delimiters. You can alter how xargs behaves with the
--null or
-0 option. It tells xargs to expect arguments separated with \000 instead of whitespace.
2. If you are feeding xargs from find, as I want to do, find has the
-print0 option. Using this option, find reports items that match separated by \000 instead of whitespace.
As presented on the xargs man-page, an example use might be
Code:
find /tmp -name core -type f -print0 | xargs --null /bin/rm -f
This example will find files named core in or below the directory /tmp and delete them, processing filenames in such a way that file or directory names containing spaces or newlines are correctly handled.
I think I can safely mark this issue solved.
Thanks to all,
~~~ 0;-Dan