Skip to content

Instantly share code, notes, and snippets.

@v-thomp4
Created December 26, 2014 10:27
Show Gist options
  • Save v-thomp4/c4d6850e3665204763eb to your computer and use it in GitHub Desktop.
Save v-thomp4/c4d6850e3665204763eb to your computer and use it in GitHub Desktop.
Sleep sort
#!/bin/bash
function f() {
sleep "$1"
echo "$1"
}
while [ -n "$1" ]
do
f "$1" &
shift
done
wait
example usage:
./sleepsort.bash 5 3 6 3 6 3 1 4 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment