Advertisement
ogre_x

Sleepsort

Feb 23rd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.11 KB | None | 0 0
  1. #!/bin/bash
  2. function f() {
  3. sleep "$1"
  4. echo "$1"
  5. }
  6. while [ -n "$1" ]
  7. do
  8.     f "$1" &
  9.     shift
  10. done
  11. wait
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement