I am new to jq and facing an issue while parsing my json
I have a json stored in a variable like this
temp='{ "1": { "my_name": "one" }, "2": { "my_name": "two" } }'
Now I need to get the value of my_name for both other entries
I have tried something like this
echo $temp | jq '.1' //out put 0.1
I was assuming to get { "my_name": "one" }
And similarly to get my_name value I did
echo $temp | jq '.1.my_name' // Its output is giving me error
Can any one please help to identify what is wrong with my syntax and how can I correct it.
echo "$temp" | ...may help. Good luck.echo "$temp"is meant to be a general bit of advice. I didn't mean to say it would solve your problem. I believe the1upvote for my comment is for my request that you edit your question to include exact command you are executing AND exact text of error message you are getting. Good luck.