Code:
#!/usr/bin/bash
IFS="="
rm -f temp temp1 temp2
while read a b
do
if [ "a$a" = "a Number of executions " ]
then
echo $b >>temp
fi
if [ "a$a" = "a Total execution time (sec.microsec)" ]
then
echo $b >>temp
fi
if [ "a$a" = "a Statement text " ]
then
d=
read d
e=
read e
echo $b $d $e >>temp
fi
done <dyn.snap.test2
IFS=" "
while read numb
do
read tot_exe_time
read stmt
average=`echo $tot_exe_time / $numb |bc`
echo $average $numb $tot_exe_time $stmt >>temp1
done <temp
sort -r -n <temp1 >temp2
while read average numb tot_exe_time stmt
do
echo "Number of executions =" $numb
echo "Total execution time (sec.microsec)=" $tot_exe_time
echo "Statement text =" $stmt
echo
done <temp2
This still runs, but the data does not prove that it works.
Five bucks a line plus HST.
