首页 > 代码库 > usage.sh
usage.sh
#########################################################################
# 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
# 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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。