7

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?

Ant Man
  • 83
  • 1
  • 4

2 Answers2

5

You can use --halt:

seq $N | parallel -j 0 --halt now,done=1 ./job.sh
Ole Tange
  • 31,768
  • 5
  • 86
  • 104
-1

You may also use killall perl. It's not accurate way, but easy to remember

yanpas
  • 2,155
  • 1
  • 17
  • 26