statistics script for counting the result of more csv files (revision1)
resultFile="./result.txt"
filepath="./scenario_name_uniq_2.txt"`cat ./*.csv > name.txt`
`awk -F "-" '{print $1,$NF}' name.txt > name1.txt`
`awk '{print $1,$NF}' name1.txt > name2.txt`
`sort name2.txt | uniq > scenario_name_uniq.txt`
`awk '{print $1}' scenario_name_uniq.txt > scenario_name_uniq_2.txt`
`sed -i 's/\[/\\\[/g' scenario_name_uniq_2.txt`
sleep 1
`sed -i 's/\]/\\\]/g' scenario_name_uniq_2.txt`
sleep 1
if [-f "$resultFile"];then
`rm result.txt`
fi
while read LINE
do
scenario_name=`echo $LINE |cut -d " " -f 1`
echo "scenario_name:"$scenario_name
scenario_name1=`echo "$scenario_name" |sed 's/\[/\\\[/g'`
echo "scenario_name1:"$scenario_name1
scenario_name2=`echo "$scenario_name1" |sed 's/\]/\\\]/g'`
echo "scenario_name2:"$scenario_name2
variable=" OK"
scenario_name_new=${scenario_name2}${variable}
echo "scenario_name_new:"$scenario_name_new
command="awk '/^$scenario_name_new$/' name2.txt | wc -l"
echo $command
size=`eval $command`
echo "size:" $size
`echo $size:pass scenario_name:$scenario_name >> result.txt`
done < $filepath
`rm name*.txt`
`rm scenario*.txt`
`sort result.txt | uniq > finalResult.txt`
`rm result.txt`