Skip to content

Instantly share code, notes, and snippets.

@marzdrel
Last active December 20, 2015 13:29
Show Gist options
  • Save marzdrel/6139710 to your computer and use it in GitHub Desktop.
Save marzdrel/6139710 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
# ./sleepsort.bash 5 3 6 3 6 3 1 4 7
# http://dis.4chan.org/read/prog/1295544154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment