| You are here: SillyDog701 > UNIX Guide >SillyDog701 > UNIX Guide > (index) |
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 occurrence.
UNIX Guide home |
search |
index
| Page URL: http://sillydog.org/unix/ [SillyDog701] [Netscape] [MozInfo701] [MacCentre701] [UNIX Guide] [AntTunes701][Forums] [Search] [Change Log] [Feedback] [About Us] [Sitemap] This UNIX Guide maintained by SillyDog701, portion of this Guide is based on UNIXhelp. UNIXhelp is copyright University of Edinburgh. This page was last modified on 14 March, 2006 |
support MozInfo701 and SillyDog701 |