Skip to content

Instantly share code, notes, and snippets.

@isaacs
Last active November 1, 2019 23:25
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 isaacs/6a491b19e983326e221c7805de23cddb to your computer and use it in GitHub Desktop.
Save isaacs/6a491b19e983326e221c7805de23cddb to your computer and use it in GitHub Desktop.
#!/bin/bash
a () {
sleep 1
echo a
}
b () {
sleep 1
echo b
}
c () {
sleep 1
echo c
}
d () {
sleep 1
echo d
}
e () {
sleep 1
echo e
}
a &
wait $(jobs -p)
b & c & d &
wait $(jobs -p)
e &
wait $(jobs -p)
@isaacs
Copy link
Author

isaacs commented Nov 1, 2019

Output:

{pause}
a
{pause}
b
c
d
{pause}
e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment