如何在GNU并行中打印失败作业的stdout和stderr?

问题描述 投票:1回答:1

我正在使用parallel --keep-order --line-buffer --halt 2在一堆命令上并行调用GNU。每隔一段时间,其中一个命令就会失败,并且GNU并行打印:

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

一旦发生这种情况,是否有任何方法可以打印仅失败作业的标准输出和标准错误?

gnu-parallel
1个回答
0
投票

neno(无错误,无输出):

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

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

所以:

parallel --halt 2 neno ...
© www.soinside.com 2019 - 2024. All rights reserved.