Hopefully someone could point me in the right direction!
My input:
{
"accounts": [
"bob.doe",
"joe.gomez",
"bill.murr"
]
}
My attempt:
acc=$(cat $file | jq -r '.accounts[]' )
echo "$acc test"
Output:
bob.doe
joe.gomez
bill.murr test
It seems to treat all the values in JSON as one array object.
Desired output:
bob.doe test
joe.gomez test
bill.murr test
Any suggestions?