Replace slash in Bash
Use sed
for substitutions:
sed 's#/#\\/#g' < filename.txt > newfilename.txt
You usually use "/
" instead of the "#
", but as long as it is there, it doesn't matter.
I am writing this on a windows PC so I hope it is right, you may have to escape the slashes with another slash.
sed
explained, the -e
lets you edit the file in place. You can use -i
to create a backup automatically.
sed -e s/STRING_TO_REPLACE/STRING_TO_REPLACE_IT/g index.html