I have a bash string default
with content
$ echo $default
{
"horses": {
"count": 0,
"fizz": "buzz"
},
"admin": {
"enabled": false
}
}
and a file override.json
with content
$ cat override.json
{
"horses": {
"count": 1,
"foo": "bar"
},
"admin": {
"enabled": true
}
}
I want to recursively merge these using jq
to produce the result
{
"horses": {
"count": 1,
"foo": "bar",
"fizz": "buzz"
},
"admin": {
"enabled": true
}
}
I've tried to understand the docs and a few things like
jq -s '.[0] * .[1]' $(echo $default) override.json
but my bash and stream skills are limited.