docs/master

annotate scripts/avg-switches @ 236:49d3aa0d128a

style: Removed unused macro code.
author markus schnalke <meillo@marmaro.de>
date Mon, 16 Jul 2012 11:31:25 +0200
parents
children
rev   line source
meillo@234 1 #!/bin/sh
meillo@234 2 #
meillo@234 3 # helper script to calculate the average number of switches
meillo@234 4
meillo@234 5 awk '
meillo@234 6 {
meillo@234 7 n1+=$2; n2+=$3; m1+=$4; m2+=$5
meillo@234 8 }
meillo@234 9 END {
meillo@234 10 printf("avg\t%d\t%d\t%d\t%d\n", n1/NR-2, n2/NR, m1/NR-2, m2/NR)
meillo@234 11 printf("sum\t%d\t%d\t%d\t%d\n",
meillo@234 12 n1-(NR*2), n2-(NR*2), m1-(NR*2), m2-(NR*2))
meillo@234 13 }' "$@"