小闹钟shell脚本

#!/bin/bash



read -p "输入你定时的时间(格式为时:分:秒):" ntime


while true

do

       now=`date +%H:%M:%S`

       echo $now

       sleep 1

       clear

       if [ "$ntime" == "$now" ];then

               for (( i=0;i<10;i++))

               do

                       echo -n "*"

                       sleep 1

               done

               break

       fi

done


echo

echo "时间到了"


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章