Skip to content

Instantly share code, notes, and snippets.

@hjst
Created September 28, 2011 04:15
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 hjst/1246971 to your computer and use it in GitHub Desktop.
Save hjst/1246971 to your computer and use it in GitHub Desktop.
./sleepsort.sh 4 6 3 2 5 9 1
#!/bin/bash
function sleepsort() {
sleep "$1"
echo "$1"
}
while [ -n "$1" ]; do
sleepsort "$1" & shift
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment