3 ms·
xargs does nothing to prevent interleaving of output from simultaneously executed commands.
by ravoori 7y ago
xargs does nothing to prevent interleaving of output from simultaneously executed commands.
- waterhouse 7y agoYes. I use parallel if I need coherent output; otherwise I use xargs (which is significantly faster).
- kylek 7y agoI suspect that's intended behavior. But if I'm understanding correctly, I think you could account for it with something like- ... | xargs -P10 -i sh -c 'command {} 1>{}.out 2>{}.err' or maybe with tee: ... | xargs -P10 -i sh -c 'command {} | tee -a {}.out'
- mechanical_jane 7y agoIt would require your input not to have any special shell chars - e.g. no space. It is definitely not something I would dare to run in production.