验证中...
7.21 杭州源创会火热报名中,一起来看看移动开发如何紧跟浪潮?
语言: Shell
分类: 其他
最后更新于 2018-07-12 22:07
片段 1 片段 2
All.sh
原始数据 复制代码
#!/bin/bash
read -p "please input result_name:xxx.txt:" result_name
echo "***************the result file ********************"
ls | grep ".outv"
echo "***************************************************"
echo -e "***********format******************
#simpleflash Response time average
# SLC_Erase_Num
# MLC_Erase_Num
# equal_Erase
# Tau
***********************************" >> ${result_name}
list=`find -name "*.outv"`
for i in $list; do
filename=${i:2}
# echo -e "file name : ${filename}\n"
echo -e "*************${filename}*****************" >>${result_name}
./SimpleExtrac.sh ${filename} ${result_name}
echo -e "****************************************\n" >> ${result_name}
done
SimpleExtrac.sh
原始数据 复制代码
#!/bin/bash
#read -p "Input handle file name:" address
#read -p "Input save result file name(include save path):" output
address=$1
output=$2
#result format
# simpleflash Response time average
# SLC_Erase_Num
# MLC_Erase_Num
# equal_Erase
# Tau
#---------------------IOdriver Response time average---------------------------
str=""
str=$( grep "simpleflash Response time average" ${address} )
#echo $str>> test.txt
str=$( echo $str | cut -d \ -f 8)
echo $str >> $output
#------------------------------SLC Block Erase--------------------------------------------
str=""
str=$( grep "SLC_Block erase" ${address} )
#echo $str >> test.txt
str=$( echo $str | cut -d \ -f 12)
SLC_Erase_Num=$str;
echo $str >> $output
#------------------------------MLC Block Erase--------------------------------------------
str=""
str=$( grep "MLC_Block erase" ${address} )
#echo $str >> test.txt
str=$( echo $str | cut -d \ -f 12)
MLC_Erase_Num=$str
echo $str >> $output
#----------------------------Compute Tau----------------------------------------
change_SLC=$( echo "${SLC_Erase_Num}/5"| bc)
equal_Erase=$(echo "${MLC_Erase_Num}/10+${SLC_Erase_Num}"|bc)
echo $equal_Erase >>$output
if [ $MLC_Erase_Num -gt $change_SLC ];then
# echo "MLC_Erase_Num: ${MLC_Erase_Num}"
# echo "change_SLC_Erase_Num: ${change_SLC}"
# echo "SLC_Erase_Num: ${SLC_Erase_Num}"
if [ $change_SLC -ne "0" ] ;then
Tau=$( echo "scale=6;${MLC_Erase_Num}/${change_SLC}"|bc)
echo "$1-->Tau : ${Tau}"
echo $Tau >> $output
else
echo -e "Tau can not Compute\t $1--->SLC_Erase_Num : ${SLC_Erase_Num}"
echo "SLC_Erase_Num : ${SLC_Erase_Num}" >> $output
fi
else
# echo "SLC_Erase_Num: ${SLC_Erase_Num}"
# echo "change_SLC_Erase_Num: ${change_SLC}"
# echo "MLC_Erase_Num: ${MLC_Erase_Num}"
Tau=$( echo "scale=6;${change_SLC}/${MLC_Erase_Num}"|bc)
echo "Tau : ${Tau}"
echo $Tau >> $output
fi

评论列表( 0 )

你可以在登录后,发表评论

11_float_left_people 11_float_left_close