I am having this issue that I want to read values from a json string in BASH and pass them on to a bash command. Basicly I want to transform e.g.:
{first: a, second: b} -> first=a second=b
{first: a, second: b, third: c} -> first=a second=b third=c
{1: a, 2:b} -> 1=a, 2=b
How would I do that so it will work no matter how many key-value pairs there are in the json string?
so far I have gotten this far:
a='{"first": "a", "second": "b"}'
echo ${a} | jq -r 'to_entries | .[] | .key + "=" + .value'
first=a
second=b
But I want it to be on the same line separated by " "