Tuesday, September 5, 2017

capture logging info from xargs comand

Here's an example of how to capture STDOUT and STERR from a set of commands parallelized using 'xargs':


Note that I'm using 'find' rather than the output of 'ls' as the input (since 'find' will not return anything if no files are found).  You can define multiple shell arguments in this way and refer to them in the normal manner ("$1", "$2", "$3", etc.).

No comments:

Post a Comment