calculate average from numbers by stdin
This commit is contained in:
parent
4cbdf35bb5
commit
eeffd07384
3
gaboshlib/g_average.sh
Normal file
3
gaboshlib/g_average.sh
Normal file
@ -0,0 +1,3 @@
|
||||
function g_average {
|
||||
cat | awk '{ sum += $1; n++ } END { if (n > 0) print sum / n; }'
|
||||
}
|
Loading…
Reference in New Issue
Block a user