How can I run a Bash command for every JSON object in a JSON array using jq? So far I have this:
jq
cat credentials.json | jq -r \'.[] | .user, .date, .
You could have jq output the commands to execute, something like
.[] | "mycommand \(.user|@sh) \(.date|@sh) \(.email|@sh)"
Then execute it. Something like
bash <(jq -r '.[] | "mycommand \(.user|@sh) \(.date|@sh) \(.email|@sh)"' foo)