首页 > 其他 > 详细

usage.sh

时间:2014-12-05 19:21:44      阅读:189      评论:0      收藏:0      [点我收藏+]
#########################################################################
# File Name: usage.sh
# Author:
# mail:
# Created Time: 2014年12月05日 星期五 15时36分52秒
#########################################################################
#!/bin/bash

if [ -z "$1" ];then
    echo -e "Usage:\n\t${0##*/} <bugreport file or dumpstate file> \n"
    exit 1
fi

echo -e "\n To find the result in $1_result.txt \n"
:> $1_result.txt
:> $1_tmp

#grep  ‘\[K\]‘ $1 | grep ‘%‘ | while read line;
grep -A 5 "CPU Usage" $1 | grep "%" | while read line;
    
    do
        tmpstr1=${line##*]}
        echo $tmpstr1 >> $1_tmp
    done;

cat $1_tmp | sort -n -r -k 1 | awk ‘{print $1 " \t"  $3 }‘ > $1_result.txt

rm $1_tmp





usage.sh

原文:http://blog.csdn.net/guan506713512/article/details/41750705

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!