将其放入while循环中。我还建议您添加一个“睡眠”,这样就不会使计算机的CPU达到最快的速度:
while true; do ########################################################################## ## CHECK TIME ########################################################################## time=$(date +%k%M) if [[ "$time" -ge 1800 ]] && [[ "$time" -le 2200 ]]; then echo "Not a good time to transpre video!" && exit 0 else echo "Excellent time to transpre video!" && echo "Lets get started!" fi ########################################################################## ## CHECK TIME ########################################################################## for i in {1..5}; do echo $i sleep 1 donedone


