You are viewing a single comment's thread. Return to all comments →
Simple readable solution
read size while read line || [ -n "$line" ]; do sum=$(($sum+$line)) done printf "%.3f" $(echo "($sum/$size)" | bc -l)
Seems like cookies are disabled on this browser, please enable them to open this website
Compute the Average
You are viewing a single comment's thread. Return to all comments →
Simple readable solution