run multiple commands in parallel


pids=""

for i in `seq 0 9`; do
   doCalculations $i &
   pids="$pids $!"
done

wait $pids

Tags:  bash

Share: