export PIDS="" for P in $PARAMS do some-command $P > /tmp/some-file.$P & PIDS="$PIDS $!" done wait $PIDS ... continue work ...