here i am parsing a json file and storing values as array.
arr1=(`jq '.animal.names' 123.json | sed...`)
output: fox tiger lion
now i need to parse values dynamically (i = birds or fish)
eg arr1=(`jq .$i.names 123.json | sed...`)
it should be as
arr1=(`jq '.bird.names' 123.json | sed...`)
or
arr1=(`jq '.fish.names' 123.json | sed...`).
Some guidance will be helpful.