🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3787

VI substitute command (and command summary)

#3787
From: Jeffrey Lawrence Haferman
Date: Thu, 08 Mar 1990 19:00
26 lines
1120 bytes
I've forgotten the exact syntax for the substitute command.
What I've been doing is

   :1,$s/old-sting/new-string/

To change old-string to new-string from lines 1 to $ (last line).

This just changes the first occurence of old-string on each line.
How do I handle multiple occurences?

Also, does anyone have a nice vi command summary?  Most that I've
seen just give the basics.  I don't think I've ever seen substitute
included (since I guess it is actually an ex command).


Please e-mail if possible.
Thanks in advance.




Jeff Haferman                            internet: jlhaferman@icaen.uiowa.edu
Department of Mechanical Engineering
University of Iowa
Iowa City IA  52240
Technical Details
Message-ID: <832@ns-mx.uiowa.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!ns-mx!l_cae05.icaen.uiowa.edu

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!ns-mx!l_cae05.icaen.uiowa.edu
From: jlhaferman@l_cae05.icaen.uiowa.edu (Jeffrey Lawrence Haferman)
Newsgroups: comp.editors,comp.unix.questions
Subject: VI substitute command (and command summary)
Message-ID: <832@ns-mx.uiowa.edu>
Date: 8 Mar 90 19:00:19 GMT
Sender: news@ns-mx.uiowa.edu
Followup-To: comp.editors
Distribution: usa
Lines: 26