Tip...

Tip...

Use global replacement in its interactive mode to avoid making changes that you don't intend. To do this add the c option to the end of the global replacement command:

   :g/pattern1/s//pattern2/gc

vi will display the first occurrence of pattern1.

To replace it with pattern2 you must enter y (yes) and press <RETURN>.

If you don't want to replace this pattern press <RETURN> to go to the next occurence.


[Home] [Search] [Index] This site maintained by unixhelp@math.rutgers.edu
This page was last updated on September 05, 2006 at 10:30 am and is maintained by webmaster@math.rutgers.edu.
For questions regarding courses and/or special permission, please contact mclausen@math.rutgers.edu.
For questions or comments about this site, please contact help@math.rutgers.edu.
© 2012 Rutgers, The State University of New Jersey. All rights reserved.