I have input files of this format
real 0.00
user 0.00
sys 0.00
real 0.00
user 0.00
sys 0.00
real 0.00
user 0.00
sys 0.00
I'm writing a bash script to get the average of the 'real' values. This is the script I've written
#! /bin/sh
# FILES=/home/myfiles
for f in $FILES
do
echo " Processing $f file.."
sum=0;
grep real $f | while read LINE; do
value=$(sed "s/[^0-9]//g")
#value=`awk "^[0-9]"`
echo $value
$sum+=$value
done
#average=$sum/10;
#echo $average
done
But I'm getting an error in this stmt
$sum+=$value
Any solutions plz ?