A long time ago, on just one system, I forgot which one, I needed explicit [Wayback/Archive] linux – Newline-separated xargs – Server Fault.
The simple solution was to replace the newline with null before running xargs
:
tr '\n' '\0'
The clean solution was to install gnu xargs:
GNU xargs (default on Linux; install
findutils
from MacPorts on OS X to get it) supports-d
which lets you specify a custom delimiter for input, so you can do
ls *foo | xargs -d '\n' -P4 foo
–jeroen