4918
5880
3万
GROAD
曲径通幽,安觅芳踪。
#!/bin/sh echo "输入要启动的程序名称:" read application echo -n "输入程序启动时间(小时):" read plan_hours if [ "$plan_hours" -gt 23 ]; then echo "输入小时数不能大于23!" exit 1 fi if [ "$plan_hours" -lt 0 ]; then echo "输入小时数不能为负数!" exit 1 fi echo -n "输入程序启动时间(分钟):" read plan_minutes if [ "$plan_minutes" -gt 59 ]; then echo "输入分钟数不能大于59!" exit 1 fi if [ "$plan_minutes" -lt 0 ]; then echo "输入分钟数不能为负数!" exit 1 fi plan_time=`echo -n "$plan_hours";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 sleep 1 if [ "$time1" -eq "$plan_time" ]; then echo "程序启动..." $application exit 0 fi done
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页
小黑屋|手机版|Archiver|曲径通幽 ( 琼ICP备11001422号-1|公安备案:46900502000207 )
GMT+8, 2025-5-4 05:29 , Processed in 0.069598 second(s), 22 queries .
Powered by Discuz! X3.2
© 2001-2013 Comsenz Inc.