LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   serch and replace in VI (https://www.linuxquestions.org/questions/linux-newbie-8/serch-and-replace-in-vi-624929/)

yusufs 03-01-2008 08:35 AM

serch and replace in VI
 
Dear all,


I have a big file like which contains /mnt//oracle in most of the places .. I want to know in VI editor, can we search for the string // and replace with / ..such that mnt//oracle will become /mnt/oracle. I know to query for a word in VI.. but for a wildcard like this how to finf out and replace ?


Thanks
Yusuf

acid_kewpie 03-01-2008 09:06 AM

since when was that a wildcard?? :confused: maybe you mean a special character? anyway, just escape it with a \

:s/\/\//\//g

Tinkster 03-01-2008 01:03 PM

Shouldn't that be
Code:

:%s/\/\//\//g
?


Cheers,
Tink

XavierP 03-01-2008 05:47 PM

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 09:14 AM.