0

For example

replace

keystore=".

with

keystore="./
ctrl-alt-delor
  • 27,473
  • 9
  • 58
  • 102
  • 1
    Is the special character in particular a problem? Do you know how you'd do that if it wasn't there? – ilkkachu Jan 28 '21 at 17:18
  • 3
    [How to replace a string with a string containing slash with sed?](https://unix.stackexchange.com/questions/39800/how-to-replace-a-string-with-a-string-containing-slash-with-sed) – steeldriver Jan 28 '21 at 17:19
  • 4
    Does this answer your question? [How to replace a string with a string containing slash with sed?](https://unix.stackexchange.com/questions/39800/how-to-replace-a-string-with-a-string-containing-slash-with-sed) – Patrick Mevzek Jan 28 '21 at 22:53

1 Answers1

0

You need to escape the special character. I take the assumption that the string is in the file yourfile

sed -i 's@keystore="\.@keystore="\./@' yourfile

More details about sed special character can be found here What characters do I need to escape when using sed in a sh script?

slamp
  • 28
  • 6