mgqw 发表于 2007-9-29 19:36:42

定时重启电脑的shell问题

小的我才开始学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

felix 发表于 2007-9-30 08:06:40

第一行错了!

#!bin/sh/应改为:
#!/bin/sh
页: [1]
查看完整版本: 定时重启电脑的shell问题