[vox] vim magic
Dylan Beaudette
vox@lists.lugod.org
Mon, 16 Feb 2004 13:42:07 -0800
> In this particluar instance, I was testing HD performance between 2
> different kernels. I was booting each kernel and running the following:
> hdparm -T /dev/hda | grep Timing | cut -d: -f2 | cut -d\= -f1
> in a loop with the output going to a file, resulting in a file that
> looked something like:
> 724 MB in 2.01 seconds
> 744 MB in 2.00 seconds
> etc. A total for the columns would have let me calculate a quick
> average.
>
why not use awk to do the summation:
...using whitespace as a delimeter $4 = time column
awk '{x = x + $4} END {print x}' input_file
..output will be the sum of column 4
dylan