Results 1 to 3 of 3
I want to replace the following string:
mnt\I\F
with:
mnt\F\F
I know to use something like:
sed -i 's/I/F/g' filename
but don't understand how to process the \ characters, using:
...
- 08-23-2011 #1Just Joined!
- Join Date
- Aug 2011
- Posts
- 2
replacing string in a file
I want to replace the following string:
mnt\I\F
with:
mnt\F\F
I know to use something like:
sed -i 's/I/F/g' filename
but don't understand how to process the \ characters, using:
sed -i 's/mnt\I\F/mnt\F\F/g' filename
isn't working.
I want to do something like:
find . -type f -exec sed -i 's/mnt\I\F/mnt\F\F/g' {} \;
- 08-24-2011 #2
Escape the backslashes:
Code:find . -type f -exec sed -i 's/mnt\\I\\F/mnt\\F\\F/g' {} +
- 08-24-2011 #3Just Joined!
- Join Date
- Aug 2011
- Posts
- 2
Thanks for your help. Thought for sure I tried that, but guess I didn't since it worked


Reply With Quote