系统集成系统维护aix 6

AIX 健康检查脚本

各位 大神,请解释一下脚本都是什么意思? RC=0unset resultresult=`uptime | grep days | awk '{print $3}'`if [ ! -z "${result}" ] ; then        if [ ${result} -gt 8000 ] ; then            ...显示全部
各位 大神,请解释一下脚本都是什么意思?



RC=0

unset result
result=`uptime | grep days | awk '{print $3}'`
if [ ! -z "${result}" ] ; then
        if [ ${result} -gt 8000 ] ; then
                echo "System is up over 8000 days; this is a sign of a corrupt /etc/utmp file."
                RC=1
        fi
fi

if [ ${RC} -eq 0 ] ; then
        result=`who -r`
        if [ -z "${result}" ] ; then
                echo "Unable to determine run-level with the who -r command."
                echo "This is a sign of a corrupt /etc/utmp file."
                RC=1
        fi
fi

return ${RC}收起
参与15

查看其它 13 个回答sakidodo的回答

sakidodosakidodo系统工程师
要开始学习学习shell编程了
互联网服务 · 2012-11-15
浏览2344

回答者

sakidodo
系统工程师
擅长领域: 服务器AIXUnix

sakidodo 最近回答过的问题

回答状态

  • 发布时间:2012-11-15
  • 关注会员:1 人
  • 回答浏览:2344
  • X社区推广