0

Ok I am trying to find a way I can run

hdparm -t /dev/sda

10 time and grab the output and get an average result.

This does not give me what I am looking for: Can't figure out how to grab just the MB/sec

counter=1
total=''
average=''
while [ $counter -le 10 ] 
do 
 echo " "
 echo -n "SD Card Read Cache Test: $counter"
 output=$(sudo hdparm -T /dev/mmcblk0 )
 echo " "
 total=$total+$output
 ((counter++))
done
average=$((total/10))
echo $average
Albert Mulder
  • 147
  • 1
  • 12

1 Answers1

2

If that's the only problem you have:

output=$(sudo hdparm -t /dev/sda 2>&1 | sed -e '/Timing buffered/ s/.*= *\([0-9.]*\).*/\1/ p; d')
Cupcake Protocol
  • 661
  • 3
  • 10