A question on .exrc while using vi

Marc Unangst mju at mudos.ann-arbor.mi.us
Wed Dec 5 13:03:37 AEST 1990


joshi at motcid.UUCP (Abhay B. Joshi) writes:
> I have a simple text-file containing the following text (3 lines): 
> 
> 	The goal:
> 	All I am trying to do is replace the 'the's by 'an's.
> 	That's all.

Son, vi is the wrong tool for the job.

ed file <<Frobozz
1,$g/the/s//an/g
w
q
Frobozz

or

sed 's/the/an/g' file >file.new

(You could use awk to do it, too, but awk is really the wrong tool for
the job here.  The nice thing about Unix is that it has so many
different tools to choose from.)

--
Marc Unangst               |
mju at mudos.ann-arbor.mi.us  | "Bus error: passengers dumped"
...!umich!leebai!mudos!mju | 



More information about the Comp.unix.questions mailing list