if [[ $all > 60 ]] ; then
starttime=`cat $file |awk '{print $13}'|sort -r|tail -1`
stoptime=`cat $file |awk '{print $13}'|sort -n|tail -1`
loadavg=`cat $file |awk '{avg1+=$10;avg2+=$11;avg3+=$12}END{print avg1/NR,avg2/NR,avg3/NR}'`
high=`cat $file |awk '{print $10}'|sort -n|tail -1`
low=`cat $file |awk '{print $10}'|sort -r|tail -1`
printf "$starttime /n load average $loadavg /n high $high /n low $low /n $stoptime /n/n" > j
#printf "load average $startus /n" >>j
#mv $f $f.$b
fi
下面是另外一个人写的,也分享下
新闻热点
疑难解答