Search code examples
gnu-parallel

How can I stop gnu parallel jobs when any one of them terminates?


Suppose I am running N jobs with the following gnu parallel command:

seq $N | parallel -j 0 --progress ./job.sh

How can I invoke parallel to kill all running jobs and accept no more as soon as any one of them exits?


Solution

  • You can use --halt:

    seq $N | parallel -j 0 --halt now,done=1 ./job.sh