-1

I want to remove <br /> from a file using sed -i ....

The / gives me trouble.

This works:

sed -i e 's/<br/''/g' File.txt

But this didn't work:

sed -i e 's/'<br />'/''/g' File.txt
Jongware
  • 22,200
  • 8
  • 54
  • 100

1 Answers1

0

Use any other char after the s

sed -i 's_/_+_'

Should work

the s subcommand from sed means substitution, and uses the next char as a delimiter, it could be almost anything. but it is a good pratice to not use any char that is related to your target text (HTML in this case), like <>/#.

Also it is advisable to avoid shell relevant ones $!()

Rafareino
  • 2,515
  • 1
  • 19
  • 26