parallel execution with xargs

Developer from somewhere

Useful trick seen in the vagrant-cassandra repo

$ cat <<EOF | xargs -P3 -I"BOXNAME" sh -c "vagrant up --provision BOXNAME"
node0
node1
node2
EOF

This can also be used with bash functions, but first you have to export them:

export -f some_function

cat <<EOF | xargs -P3 -I"BOXNAME" sh -c "some_function BOXNAME"
node0
node1
node2
EOF