0

I'm trying to replace ..\ with ..\..\.

(I moved a folder and need to manipulate file paths in an xml.)

I finally got my command to go without errors, but didn't get the result I wanted, can anybody tell me whats wrong?

Here is what I tried sed -i -e 's|..\\|..\\..\\|g' file.xml

  • 1
    . is a match any char, needs to be escaped. – danblack Dec 4 '18 at 2:20
  • Don't use -i until after you are sure you are going to get the correct result. – NickD Dec 4 '18 at 2:37
  • I more of an Try and Fail and restore backup and try again kinda guy :P @NickD – FreeSoftwareServers Dec 4 '18 at 2:54
0
sed -i -e 's|\.\.\\|\.\.\\.\.\\|g'

Using sed to replace special characters

I didn't realize I had to escape .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.