How can I run a Bash command for every JSON object in a JSON array using jq
? So far I have this:
cat credentials.json | jq -r '.[] | .user, .date, .email' | mycommand -u {user} -d {date} -e {email}
This doesn't seem to work. How can I take the parameters out of the JSON array into my command?
My JSON file looks something like this:
["user": "danielrvt","date": "11/10/1988","email": "myemail@domain.com", ...]