home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / question / 11002 < prev    next >
Encoding:
Internet Message Format  |  1992-09-12  |  798 b 

  1. Path: sparky!uunet!zephyr.ens.tek.com!tekig7!tekig5!naren
  2. From: naren@tekig5.pen.tek.com (naren)
  3. Newsgroups: comp.unix.questions
  4. Subject: Replacing words
  5. Message-ID: <6937@tekig7.PEN.TEK.COM>
  6. Date: 12 Sep 92 23:08:11 GMT
  7. Sender: news@tekig7.PEN.TEK.COM
  8. Distribution: usa
  9. Organization: Tektronix, Inc., Beaverton,  OR.
  10. Lines: 23
  11.  
  12. Hi,
  13.  
  14. I was trying to replace occurrences of XXX with another word YYY.
  15. I was able to do it two ways.
  16.  
  17. 1.  I went into the vi editor.
  18.     /XXX
  19.    [ESC] cw
  20.    Then I kept hitting n and .
  21.  
  22. 2. I wrote a macro in vi.
  23. The basic structure was as follows.
  24. map v: /XXX cw YYY 
  25.  
  26. 3. I tried out a third one.
  27. This one did not work for some reason.
  28.  
  29. :$s /XXX/YYY/g
  30.  
  31. If anyone can come up with better ways, email me
  32.  
  33. Naren
  34. email address: naren%tekig5.pen.tek.com@ucbvax.berkeley.edu
  35.