1

is exist any solution to use this sed (sed have problems with [ ] symbols):

sed -i "s|$old|$new|" $pathtofile

When i have in file on specific line string with "[]", for example:

something1 = [value]

In $old variable i have this line. Maybe some kind of reading variable and adding backslash before every [ or ] symbol? It is possible? Or is there better way to do it. I need to change line in file.

0 Answers0