Skip to content

Instantly share code, notes, and snippets.

@mmazer
Created September 24, 2012 02:01
Show Gist options
  • Select an option

  • Save mmazer/3773811 to your computer and use it in GitHub Desktop.

Select an option

Save mmazer/3773811 to your computer and use it in GitHub Desktop.
Unix: Sleep sort
#!/bin/bash
function f() {
sleep "$1"
echo "$1"
}
while [ -n "$1" ]
do
f "$1" &
shift
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment