pattern search with sed

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

  1. Use code tags around your code.
  2. Don't redirect your sed output before you get the right result.
  3. 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

Try:

sed 's/" / /g' INPUTFILE

it will not work " is a special character so we need to use backslash before that .....
but still not succeed what i want :frowning:

It will work. Just try and then learn about ordinary and double quotes in shell.