Hands-on task
jq --arg: a parameter from the shell
/root/users.json holds an array of objects with name and age fields; some names contain spaces and quotes. Write a script /root/age.sh: it takes a name as its first argument and prints that user's age. Don't paste the name into the filter text — pass it to jq as a variable via --arg. Run the script for Bob (bash /root/age.sh Bob) and write the result to /root/age.txt.
- jq
- --arg
- variables
- select
- parameterization