LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 803|回复: 1

请跳出下面shell脚本中的错误,并说明错在哪里

[复制链接]
发表于 2006-3-11 19:16:21 | 显示全部楼层 |阅读模式
Shell脚本阅读(解释下面执行的功能)
    请跳出下面程序或脚本中的错误,并说明错在哪里。
#!/bin/bash
#监控cpuser的point端口是否正常
logname="/home/forum/log/lpointlog.wf"
flagfile="/home/forum/log/lognum.txt"
oldnum=sed -n "1,1 p"$flagfile
newnum=wc -l ${logname}
echo $newnum >$flagfile
totalnum=expr $newnum -$oldnum
tail -n $totalnum $logname |grep "OINT_THREAD WARNING"
if [$?==0]
then
   mail -s "cpuser point 端口异常,请处理!" test@aa.com[/email][/email]</dev/null
发表于 2006-3-12 16:28:34 | 显示全部楼层
I think
  1. echo $newnum >$flagfile
复制代码
doesn't have any meaning if it is not a test statment but just an echo. And there is a if but no fi...
回复 支持 反对

使用道具 举报

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

本版积分规则

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