4 ms·
Protip: for "strange" characters, see the -0 argument to xargs. If the file list comes from find, see the -print0 argument there. find -print0 | xargs -0 -
by martinflack 10y ago
Protip: for "strange" characters, see the -0 argument to xargs. If the file list comes from find, see the -print0 argument there.
find -print0 | xargs -0 -n1 echo
echo -n "file '#1'\0file '#2'\0" | xargs -0 -n1 -I{} echo "the file is \"{}\", ok?"
- krick 10y agoOh yeah, great I idea. Now insert sorting somewhere between the pipes and use at least one filename with '"' character. Good luck with your xargs. parallel handles all this automatically, you don't even have to know there might be any problems with escaping here.
- martinflack 10y agoThanks - I will take a closer look at parallel.