Bash & (ampersand) operator

后端 未结 4 682
轮回少年
轮回少年 2020-12-14 02:52

I\'m trying to run 3 commands in parallel in bash shell:

$ (first command) & (second command) & (third command) & wait

The prob

4条回答
  •  长情又很酷
    2020-12-14 03:26

    This might work for you:

    parallel -j3 --halt 2 

    This will run 3 commands in parallel.

    If any running job fails it will kill the remaining running jobs and then stop, returning the exit code of the failing job.

提交回复
热议问题