3

I'm invoking GNU parallel on a bunch of commands using parallel --keep-order --line-buffer --halt 2. Every once in a while one of the commands fails, and GNU parallel prints:

 parallel: This job failed:
    <failing command comes here>

Is there any way to to print the stdout and stderr of ONLY the failed job whenever this happens?

Saurabh Nanda
  • 6,373
  • 5
  • 31
  • 60

1 Answers1

2

neno (no-error-no-output) does that:

neno 'echo stdout; echo stderr >&2; false'
neno 'echo stdout; echo stderr >&2; true'

https://gitlab.com/ole.tange/tangetools/-/tree/master/neno

So:

parallel --halt 2 neno ...
Ole Tange
  • 31,768
  • 5
  • 86
  • 104