I need to find and replace a big part of a json file using shell. For exemple I have this file :
{
"Balise1": true,
"Balise2": true,
"OtherThingEnabled": false,
"proxySettings": {
"port": 0
},
"mailSettings": {},
"maxRunningActivitiesPerJob": 5,
"maxRunningActivities": 5,
}
I need to clear what's inside the brackets of the "proxySettings" and replace it with :
"proxySettings": {
"host": "my-proxy.host.com",
"port": 80
}
I can't be sure how many lines there will be in the file at the beggining. Could be one, several or none. The only thing I am sure, is the brackets. I need it to be properly indent.
I've looked sed function using redex, but I am stuck with the number of line being unknown.
Could you help ? Thanks
sed
or other tools would work for you ? As your file is a valid json file tool aware should be used