shell中如何实现隔段时间执行下一个命令?

2025-03-14 20:50:05
推荐回答(2个)
回答(1):

使用sleep命令,比如
echo "1" #执行第一个命令
sleep 2 #sleep 2秒
echo "2" #执行第二个命令

回答(2):

sleep 2
等待2秒