#!/bin/bash
a=1
for ((i=0;i<20;i++));do
{
echo $i-`date +%T`
} &
[[ $a%5 -eq 0 ]] && wait && sleep 2
let a++
done
wait
echo Done
时间: 2024-10-06 23:48:49
#!/bin/bash
a=1
for ((i=0;i<20;i++));do
{
echo $i-`date +%T`
} &
[[ $a%5 -eq 0 ]] && wait && sleep 2
let a++
done
wait
echo Done