Xref: utzoo comp.unix.misc:696 comp.unix.questions:27466 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!texsun!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.misc,comp.unix.questions Subject: Re: A question on .exrc while using vi Keywords: exrc vi Message-ID: <110105@convex.convex.com> Date: 9 Dec 90 15:48:21 GMT References: <5315@graphite20.UUCP> <1990Dec9.033641.9731@csn.org> Sender: news@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Followup-To: comp.editors Organization: CONVEX Software Development, Richardson, TX Lines: 25 In article <1990Dec9.033641.9731@csn.org> skwu@spot.Colorado.EDU (WU SHI-KUEI) writes: :>> The goal: :>> All I am trying to do is replace the 'the's by 'an's. :>> That's all. :Sonny boy, it ain't all that easy - your solution changes all instances of :'theatre' to 'anatre', 'gather' to 'gaanr', etc., etc. It takes three commands :in 'ed' or 'sed' to accomplish the original task: : : g/^the /s//an/g : g/ the /s//an/g : g/ the$/s//an/g : :If the 'the's may be preceded or followed by tabs as well as spaces, things :may be even more complicated. *PLEASE* don't spread misinformation. All it takes is a simple \ in the expression to take care of those cases. %s/\/an/g --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "With a kernel dive, all things are possible, but it sure makes it hard to look at yourself in the mirror the next morning." -me