I specify the address space between "{" and "}," in sed, so I expect only the first "Acer" to be replaced to "TTTT". Second one is not expected. How can I fix this problem ? I did test on 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,
}
]
