QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2772|回复: 1

定时重启电脑的shell问题

[复制链接]
发表于 2007-9-29 19:36:42 | 显示全部楼层 |阅读模式
小的我才开始学shell编程,想写一个定时关机的小脚本。
经过多方查找资料,得知可以使用定时命令at实现,比如说要电脑2天后1点20自动重启可以用  
at 1:20 tomorrow /bin/reboot   可是在我的电脑上使用好像有问题 ,就算用超级用户还是会报错(我的系统撒ubuntu7.04),写成shell脚本也编译不过,请各位大侠指教,程序报错如下:
syntax error. Last token seen: /
Garbled time
脚本程序也很简单,如下:
#!bin/sh/

#restart the computer in the define times

at 1:20 tomorrow /bin/reboot

exit 0
发表于 2007-9-30 08:06:40 | 显示全部楼层

第一行错了!

#!bin/sh/应改为:
#!/bin/sh
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-20 17:45 , Processed in 0.061186 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表