I am specifying the address space between "{" and "}" in sed, so I expect that only the first "Acer" will be replaced by "TTTT". The second is not expected. How can I fix this problem? I tested Ubuntu 15.10 and sed version is sed (GNU sed) 4.2.2.
Thanks in advance.
$ echo " [ { \"manufacturer\": \"Acer\", \"regularPrice\": 165.99, }, [ \"manufacturer\": \"Acer\", \"regularPrice\": 165.99, ], { \"manufacturer\": \"Acer\", \"regularPrice\": 165.99, } ] " | sed "/{/,/},/ {s/\"Acer\"/\"TTTT\"/}"
Its results are as follows:
[ { "manufacturer": "TTTT", "regularPrice": 165.99, }, [ "manufacturer": "Acer", "regularPrice": 165.99, ], { "manufacturer": "TTTT", "regularPrice": 165.99, } ]
source share