Parallel Processing with Bash
There is often the need to run several bash scripts in parallel. To achieve this, one need to keep track of the running processes. Here’s my solution: #!/bin/bash # parallel child processes PP=5 if [ -n "$1" ]; then sleep $1 exit fi reaper () { echo “waiting to finish” >&2 wait exit 0 } [...]