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
jq 'to_entries[] | "\(.key)=\(.value)"'
should do it
Another way to join the values is to use string concatenation:
jq -r 'to_entries[] | .key + "=" + .value'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With