Replacing Text in Text file

Hi Guys,

I am needing some help writing a shell script to replace the following in a text file

/opt/was/apps/was61

with some other path eg

/usr/blan/blah/blah.

I know that i can do it using sed or perl but just having difficulty writing the escape characters for it

All Help appreciated

Regards,
Chris

sed 's!/opt/was/apps/was61!/usr/blan/blah/blah!'

Regards

sed 's!/opt/was/apps/was61!/usr/blan/blah/blah!' test.bak

Doesnt appear to work where test.bak is the file containing /opt/was/apps/was61

it spits out /usr/blan/blah/blah before the command prompt but doesnt change the file at all.

Anymore help would be much appreciated.

Regards

sed doesn't change your file on the fly. use output redirection or if your sed support -i , you can use it.