Average numbers echo’ed in bash

I’m tired of figuring this out again and again. This will average your output.

cat *latency.csv |cut -f5 -d,| awk '{sum+=$1; count++} END {if (count > 0) print "Average:", sum/count}'

Leave a Reply