Skip to content

Instantly share code, notes, and snippets.

@devos50
Created January 3, 2018 15:00
Show Gist options
  • Save devos50/6d6b9013a13e521a5a718ea576e7d363 to your computer and use it in GitHub Desktop.
Save devos50/6d6b9013a13e521a5a718ea576e7d363 to your computer and use it in GitHub Desktop.
set -e
shopt -s nocasematch
pids=""
for i in {1..10}; do
sleep 5 &
pids+=" $!"
done
for p in `echo $pids`; do
if wait $p; then
echo "Process $p success"
else
echo "Process not success"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment