Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding a "/" in Vi? 1

Status
Not open for further replies.

maddave

Technical User
Jan 3, 2002
72
GB
How can I use VI to find a "/"? For example, I have a script which moves a lot of files to another directory. The directory structure in the script is wrong so I want to search for "$HOME/stnd_by/one" and replace it with just "$HOME/one"

if I do:
:%s/stnd_by//g

I end up with "$HOME//one" on all lines.

Sticking the search expression in quotes doesn't work.

Thanks.
 
Escape the / with \
Code:
:%s/stnd_by\///g

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top