So I have two JSON files:
bosh.json:
{
\"key_pair_name\": \"my-aws-keypair\",
\"ssh_private_key\": \"my-key-name\",
\"trusted_certific
jq solution:
jq --argfile bosh bosh.json 'with_entries(
if $bosh[.key] then .value = $bosh[.key] else . end)' model.json
The output:
{
"trusted_certificates": "my-trusted-certs",
"vm_password_type": "generate"
}
if $bosh[.key] then .value = $bosh[.key] else . end
- update model's value only for matched keys