4918
5880
3万
GROAD
曲径通幽,安觅芳踪。
#!/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
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )
GMT+8, 2025-5-4 04:44 , Processed in 0.077734 second(s), 22 queries .
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.