#!/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

转自:http://bbs.seu.edu.cn/bbstcon.php?board=Linux&gid=41215

posted on 2011-06-18 16:07  吃吃户  阅读(248)  评论(0编辑  收藏  举报