-1

How can I use / in sed to find and replace as a normal / and not a special charatcer.

αғsнιη
  • 41,407
  • 1
    https://unix.stackexchange.com/questions/32907/what-characters-do-i-need-to-escape-when-using-sed-in-a-sh-script – John May 18 '18 at 02:29

1 Answers1

2

sed can use any other delimiter than slash, whatever comes after s is treated as a delimiter For eg: you can use a hash to replace slash by space

$ s#/# #g

Or you can use ? to replace / by space

$ s?/? ?g

Or any other delimiter of your choice

Or you can escape / by using backslash

$ s/\// /g
αғsнιη
  • 41,407
Arushix
  • 1,290