#!/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 "时间到了"
转载于:https://blog.51cto.com/bingwzi/1395633