Hands-on task
This task is step 4 of the course “awk and datamash: reports from tables”
awk: average of a column
/root/vals.txt has one number per line. Compute their arithmetic mean and write the result (an integer) to /root/avg.txt.
Reference:awk
What you'll practise:
- awk
- sum accumulator
- NR variable
- END block
- average