docs/master

diff scripts/avg-switches @ 234:eba3744fb238

Added my set of helper scripts. Removes the spell makefile target as it was not use{d,ful} anyway. Btw: I should have ran script/doubles before I printed the document. :-/
author markus schnalke <meillo@marmaro.de>
date Mon, 16 Jul 2012 11:23:30 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/scripts/avg-switches	Mon Jul 16 11:23:30 2012 +0200
     1.3 @@ -0,0 +1,13 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# helper script to calculate the average number of switches
     1.7 +
     1.8 +awk '
     1.9 +{
    1.10 +	n1+=$2; n2+=$3; m1+=$4; m2+=$5
    1.11 +}
    1.12 +END {
    1.13 +	printf("avg\t%d\t%d\t%d\t%d\n", n1/NR-2, n2/NR, m1/NR-2, m2/NR)
    1.14 +	printf("sum\t%d\t%d\t%d\t%d\n",
    1.15 +			n1-(NR*2), n2-(NR*2), m1-(NR*2), m2-(NR*2))
    1.16 +}' "$@"