I would like to modify a json file using JQ in a Bash script. Here is what I tried to proceed:
var="test-54342"
echo "$( jq '.context["customer-name"] = "$var"' cdk.json )" > cdk.json
I also tried this but it's not working as well:
var="test-54342"
echo `$( jq '.context["customer-name"] = "$var"' cdk.json )` > cdk.json
Here is what my json file looks like:
{
"app": "mySuperApp",
"context": {
"customer-name": "text-I-want-to-modify"
}
}