Let's say i got the following json response:
{
"author": "tomek",
"title": "helloworld",
"test": "sampletextonetwothree"
}
Is it possible to display something like this: (using jq)
author=tomek
title=helloworld
test=sampletextonetwothree
Let's say i got the following json response:
{
"author": "tomek",
"title": "helloworld",
"test": "sampletextonetwothree"
}
Is it possible to display something like this: (using jq)
author=tomek
title=helloworld
test=sampletextonetwothree
Another way to join the values is to use string concatenation:
jq -r 'to_entries[] | .key + "=" + .value'
There is probably a better way, but this works:
cat response.json | jq -r 'to_entries| map([.key, .value]) | map([join("=")]) | flatten | .[]'
or
cat response.json | jq -r 'to_entries | map([.key, .value]) | .[] | join("=")'