#判断进程心跳文件的时间,支持四种系统
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/时/:/'`
else
echo "don't suppotr $os"
fi
生成结果:
10:25