Mercurial > hg > Members > shoshi > cassandra_jungle_benchmark
view calc_avg.sh @ 0:580b2753e17c default tip
hg init
author | Shoshi TAMAKI |
---|---|
date | Wed, 20 Feb 2013 20:14:09 +0900 |
parents | |
children |
line wrap: on
line source
#!/bin/sh function average() { total=0.0 count=0 while read time do total=`echo $total + $time | bc` count=`echo $count + 1 | bc` done avg=`echo "scale=4;$total/$count" | bc` echo "$count,$avg" } for arg in $@ do average < $arg done