Trying to replace '/' with '\/' in files using bash
Hi,
I'm using bash and am trying to find all / and replace with \/ in a line of text.
Basically, I want
/home/project/testfile
to become
\/home\/project\/testfile
I've tried many iterations of
sed -i s/'/'/'\/'/ testfile.dat
using single quotes, double quotes, and "\" to no avail. Any suggestions?
Thank you!
|