Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Run bash commands in parallel
function mycommand {
sleep 1
for i in $(seq 1 10); do
mycommand & PIDS+=($(echo $! | sed 's/^\[[0-9]*\]//'));
wait ${PIDS[*]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.