How to append string in bash script using sed?

Viewed 231

Hello I am trying to make a script to edit chrome flags on mac using a bash script. This script is to set max SSL to TLS1.3 on chrome. However, I am having some issues with sed. Here is what my command looks like:

sed -i '.bak' -e 's/{\"browser\".*origin\":\"\"\}/\"browser\":\{\"enabled_labs_experiments\":\[\"ssl-version-max@2\"\],\"last_redirect_origin\":\"\"\}/g' "./Local State"

The goal is to append

"enabled_labs_experiments":["ssl-version-max@2"]

to this

{"browser":{"last_redirect_origin":""}

to make it looks like this

{"browser":{"enabled_labs_experiments":["ssl-version-max@2"],"last_redirect_origin":""}

Not sure what's wrong with my command but any help in achieving this is really appreciated or just pointing me in right direction would help greatly.

Thanks!

3 Answers
Related