IBM-AIX、SunOS、Linux、HP-UX上获取心跳时间

来源:互联网 发布:淘宝转微信链接 编辑:程序博客网 时间:2024/06/05 06:29
#判断进程心跳文件的时间,支持四种系统
OS=`uname`if [ $OS = "SunOS" ] || [ $OS = "Linux" ]then    FileT=`ls -lt $DaFile|grep Alarm.log|awk '{print $8}'`elif [ $OS = "HP-UX" ] || [ $OS = "AIX" ]then    FileT=`ls -lt $DaFile|grep Alarm.log|awk '{print $7}'`    FileT=`echo "$FileT" | sed 's/时/:/'`elseecho "don't suppotr $os"fi

生成结果:

10:25