Hi,
I want to do replacing of some pattern by using sed.
pattern : " white space / to white space /
script is :
sed -e s/\"\$hi/\$hi/ \
-e s/\"\ \\/\\/ \
test.res > test.output
+ sed -e 's/"$hi/$hi/' -e 's/" \/\/' test.res
sed: -e expression #2 , char 8: unterminated `s' command
test.res file contain : "$hi " \
please help
-bhrat
yazu
August 19, 2011, 8:18am
2
Use code tags around your code.
Don't redirect your sed output before you get the right result.
Try one sed expressions a time. Test
sed 's/something/another thing/' INPUTFILE
at first, then add another "s" command:
sed 's/.../.../ ; s/.../.../' INPUTFILE
first statement : sed -e s/\"\$hi/\$hi/ \ working fine replacing the patten in test.out file .
but in second one : test.res file contain space between " and / and i want to replace it to space and / ....please help
-bhrat
it will not work " is a special character so we need to use backslash before that .....
but still not succeed what i want
yazu
August 19, 2011, 8:40am
6
It will work. Just try and then learn about ordinary and double quotes in shell.