Re: Vi search and replace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Phil wrote:
Hello,

I am trying to do a search and replace in vi but I need to search and replace on "/T"

so how do I escape the /?

%s/"/T"/T/g obvisouly does not work....

how do I specify a / in the vi search string?


For example:

:1,$s!/!!g

is the same as

:1,$s/\//g

removes all / chars in all lines (you can use another search pattern delimiter instead of "/" - this is "!" here). In this way, escaping is not needed.

--
Joachim Backes <joachim.backes@xxxxxxxxxxxxxx>
University of Kaiserslautern,Computer Center [RHRK],
Systems and Operations, High Performance Computing,
D-67653 Kaiserslautern, PO Box 3049, Germany
--------------------------------------------------
Phone: +49-631-205-2438, FAX: +49-631-205-3056
http://hlrwm.rhrk.uni-kl.de/home/staff/backes.html

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux