A question on .exrc while using vi

Tom Christiansen tchrist at convex.COM
Mon Dec 10 02:48:21 AEST 1990


In article <1990Dec9.033641.9731 at csn.org> skwu at 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 \<the\> in
the expression to take care of those cases.

    %s/\<the\>/an/g

--tom
--
Tom Christiansen		tchrist at 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



More information about the Comp.unix.questions mailing list