Hands-on task
This task is step 7 of the course “JSON, YAML and XML in the terminal”
jq: sum over an array
/root/orders.json is an array of objects with an amount field. Compute the sum of all amount values and write the number to /root/total.txt.
What you'll practise:
- jq
- aggregation
- the add function
- pipeline in jq
- working with arrays