Hands-on task
This task is step 3 of the course “awk and datamash: reports from tables”
awk: sum of a column
/root/cart.txt has two columns: item and quantity. Compute the sum of the quantities (the second field) and write the number to /root/total.txt.
Reference:awk
What you'll practise:
- awk
- accumulator variable
- END block
- summing a column