#!/bin/bash
test () {
echo $a
sleep 2
}
for a in $(seq 10);do
test &
((num++))
if [[ $num -eq 6 ]];then
wait
num=0
fi
done
wait
转载于:https://blog.51cto.com/8456082/1418606
#!/bin/bash
test () {
echo $a
sleep 2
}
for a in $(seq 10);do
test &
((num++))
if [[ $num -eq 6 ]];then
wait
num=0
fi
done
wait
转载于:https://blog.51cto.com/8456082/1418606