#!/bin/sh
flag=0
plan_hour=19
plan_minutes=47
plan_time=`echo -n "$plan_hour";echo -n "$plan_minutes"`
clear
while true
do
hour=`date +"%H"`
minutes=`date +"%M"`
seconds=`date +"%S"`
time1=`echo -n "$hour";echo -n "$minutes"`
clear
echo -n "现在的时间为: "
echo -n $hour
echo -n :
echo -n $minutes
echo -n :
echo -n $seconds
if [ "$time1" -eq "$plan_time" ]; then
flag=1
clear
echo -n "3秒后关闭 1.sh"
sleep 3
ps -ef|grep "sh 1.sh"|grep -v grep|awk '{print $2}'|xargs kill
clear
echo "1.sh 已经结束;2.sh 1分钟后唤醒 1.sh"
sleep 59
fi
#plan_minutes=$(($plan_minutes+1))
#if [ $plan_minutes -eq 60 ]; then
# plan_hour=$(($plan_hour+1))
# plan_minutes=0;
# if [ $plan_hour -eq 24 ]; then
# plan_hour=0
# fi
#fi
sleep 1
if [ $flag -eq 1 ]; then
sh 1.sh
exit 0
fi
done
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |