Skip to content

Instantly share code, notes, and snippets.

@ferenczy
Created June 20, 2014 16:48
Show Gist options
  • Save ferenczy/c1b1e872d691db56f6d9 to your computer and use it in GitHub Desktop.
Save ferenczy/c1b1e872d691db56f6d9 to your computer and use it in GitHub Desktop.
#!/bin/bash
function f()
{
sleep "$1"
echo "$1"
}
while [ -n "$1" ]
do
f "$1" &
shif
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