LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to replace text using VI editor (https://www.linuxquestions.org/questions/programming-9/how-to-replace-text-using-vi-editor-541865/)

ajaz_javeed 03-30-2007 05:27 AM

How to replace text using VI editor
 
Hello everybody,

I want to replace text using VI and I know to replace a single word like :

:%s/oracle/prod/g

This will replace the word oracle with prod.

Now, I am trying to replace /oracle/oracle with /Courseware/ora9i.

How could I achieve this ?

Thanks and Regards
AJAZ

druuna 03-30-2007 05:30 AM

Hi,

You need to escape the slashes (one of the special characters).
I.e: %s/\/oracle\/oracle/\/Courseware\/ora9i/g

Hope this helps.

PS: DO NOT CROSSPOST (read the rules).

acid_kewpie 03-30-2007 07:01 AM

Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.


All times are GMT -5. The time now is 01:38 AM.