Skip to content

Instantly share code, notes, and snippets.

@gasp
Created November 27, 2017 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gasp/7939938b478172c7ad86754e55642512 to your computer and use it in GitHub Desktop.
Save gasp/7939938b478172c7ad86754e55642512 to your computer and use it in GitHub Desktop.
multiple bash processes
#!/usr/bin/env bash
sleep_date() {
echo "starting $1 at $(date)";
sleep $1;
echo "ending $1 at $(date)";
}
echo "starting all $(date)";
sleep_date 10 &
sleep_date 20 &
sleep_date 15 &
wait;
echo 'ended';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment