2008
08.23
08.23
It’s amazing how easy it is to parallelize stuff using Bash:
#!/bin/bash
PIDS=”"
for I in `seq 1 10`; do
process-to-parallelize &
PIDS=”$PIDS $!”
done
wait $PIDS
The $! will add the Process ID (PID) of the last started process into the PIDS string. The wait command will wait until all listed Process IDs have finished running.
