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