Skip to content

Latest commit

 

History

History
36 lines (21 loc) · 703 Bytes

parallel.md

File metadata and controls

36 lines (21 loc) · 703 Bytes

parallel

GNU:

sudo apt-get install parallel

There is also one in moreutils... https://superuser.com/questions/917577/how-can-i-install-gnu-parallel-alongside-moreutils-on-ubuntu-debian

Basic usage

Run echo 100 times in parallel:

seq 100 | parallel echo '{}'

Remove extension

printf 'a.c\nb.c\nc.c\n' | parallel --will-cite echo '{.}'

Outcome:

a
b
c

Very convenient!

halt

Determines what happens on failure:

seq 100 | parallel --halt=0 false
echo $?
  • 0: default. Don't halt on failure. Exit status is the number of failures.
  • 1: don't start new processes on failure. Exit status is the last failure.
  • 2: kill everyone else on failure.