change json file by bash script -
I need your help to solve the following problem: I have a JSON file that looks like this: {"key1": "value1", "key2": "value2", "key3": "value3"} How do I create a new key Can I add "code4" to "code4": "value4" ) by Bash script? Thank you : Li> On Debian-based systems such as Ubuntu, you can call it sudo apt-get jq install on OSX, with a homebree, install Jq For example, depending on the following input string - output stdout : jsonStr = "{" Key1 ":" value1 "," key2 ":" value2 "," key3 ":" value3 "} ' Remove "key3": jq 'del (.key3)' & lt; & lt; "$ jsonStr" value with value "value4" Add the key "key4": jq '"{1 key4": "value4"}' & lt; & lt; "$ jsonStr" Change the value of the...