view scripts/avg-switches @ 236:49d3aa0d128a default tip

style: Removed unused macro code.
author markus schnalke <meillo@marmaro.de>
date Mon, 16 Jul 2012 11:31:25 +0200
parents eba3744fb238
children
line wrap: on
line source

#!/bin/sh
#
# helper script to calculate the average number of switches

awk '
{
	n1+=$2; n2+=$3; m1+=$4; m2+=$5
}
END {
	printf("avg\t%d\t%d\t%d\t%d\n", n1/NR-2, n2/NR, m1/NR-2, m2/NR)
	printf("sum\t%d\t%d\t%d\t%d\n",
			n1-(NR*2), n2-(NR*2), m1-(NR*2), m2-(NR*2))
}' "$@"