sed to Find and replace with / and not special character [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-1
down vote

favorite













This question already has an answer here:



  • Replace a string including a slash “/” using sed command

    2 answers



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







share|improve this question













marked as duplicate by muru, Kusalananda, Romeo Ninov, ilkkachu, αғsнιη May 18 at 7:11


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    unix.stackexchange.com/questions/32907/…
    – John
    May 18 at 2:29














up vote
-1
down vote

favorite













This question already has an answer here:



  • Replace a string including a slash “/” using sed command

    2 answers



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







share|improve this question













marked as duplicate by muru, Kusalananda, Romeo Ninov, ilkkachu, αғsнιη May 18 at 7:11


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    unix.stackexchange.com/questions/32907/…
    – John
    May 18 at 2:29












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite












This question already has an answer here:



  • Replace a string including a slash “/” using sed command

    2 answers



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







share|improve this question














This question already has an answer here:



  • Replace a string including a slash “/” using sed command

    2 answers



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





This question already has an answer here:



  • Replace a string including a slash “/” using sed command

    2 answers









share|improve this question












share|improve this question




share|improve this question








edited May 18 at 2:28









αғsнιη

14.7k82361




14.7k82361









asked May 18 at 2:20









Ayush Sharma

1




1




marked as duplicate by muru, Kusalananda, Romeo Ninov, ilkkachu, αғsнιη May 18 at 7:11


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by muru, Kusalananda, Romeo Ninov, ilkkachu, αғsнιη May 18 at 7:11


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 1




    unix.stackexchange.com/questions/32907/…
    – John
    May 18 at 2:29












  • 1




    unix.stackexchange.com/questions/32907/…
    – John
    May 18 at 2:29







1




1




unix.stackexchange.com/questions/32907/…
– John
May 18 at 2:29




unix.stackexchange.com/questions/32907/…
– John
May 18 at 2:29










1 Answer
1






active

oldest

votes

















up vote
2
down vote













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





share|improve this answer























  • It's not GNU specific, any sed can do that. Same in ed (where that s|...|...| comes from in the late 60s), or ex/vi or perl.
    – Stéphane Chazelas
    May 18 at 7:48


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













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





share|improve this answer























  • It's not GNU specific, any sed can do that. Same in ed (where that s|...|...| comes from in the late 60s), or ex/vi or perl.
    – Stéphane Chazelas
    May 18 at 7:48















up vote
2
down vote













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





share|improve this answer























  • It's not GNU specific, any sed can do that. Same in ed (where that s|...|...| comes from in the late 60s), or ex/vi or perl.
    – Stéphane Chazelas
    May 18 at 7:48













up vote
2
down vote










up vote
2
down vote









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





share|improve this answer















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






share|improve this answer















share|improve this answer



share|improve this answer








edited May 18 at 8:15









αғsнιη

14.7k82361




14.7k82361











answered May 18 at 2:30









Arushix

9968




9968











  • It's not GNU specific, any sed can do that. Same in ed (where that s|...|...| comes from in the late 60s), or ex/vi or perl.
    – Stéphane Chazelas
    May 18 at 7:48

















  • It's not GNU specific, any sed can do that. Same in ed (where that s|...|...| comes from in the late 60s), or ex/vi or perl.
    – Stéphane Chazelas
    May 18 at 7:48
















It's not GNU specific, any sed can do that. Same in ed (where that s|...|...| comes from in the late 60s), or ex/vi or perl.
– Stéphane Chazelas
May 18 at 7:48





It's not GNU specific, any sed can do that. Same in ed (where that s|...|...| comes from in the late 60s), or ex/vi or perl.
– Stéphane Chazelas
May 18 at 7:48



Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay