🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3530

Re: Vi bashing or counting lines

#3530
From: Franz Schmausser
Date: Tue, 11 Apr 1989 12:17
41 lines
2161 bytes
In article <175@hcr.UUCP> stacey@hcrvax.UUCP (Stacey Campbell) writes:
>In article <4129@ttidca.TTI.COM> kevin@ttidcb.tti.com (Kevin Carothers) writes:
>
>The original question by the beginner user was "I want to delete lines
>in vi, but I need to know an easy way to count the lines for deletion?"
>This implies that user knew only one way to delete lines in vi, namely
>
>	[integer]dd
>
>So you, my extremely misguided friend, offer;
>
>	'a,'bw! wc -l

Are YOU all joking ???
It's easy to count lines in vi without forking any subprocesses:

	'ay'b

and vi reports:

	... lines yanked
		

The report variable should be set to a small value (:set report=2)

>
>to achieve the calculation of the integer.  This amounts to a
>minimum of two execs and one fork (more likely two) to count
>a range of marked lines so that a value can be prefixed to dd.
>
>Obviously an extremely expensive and stupid way to delete lines.
>

As always RTFM ...

.------------------------------------------------------------------------------.
|  Franz "Oin" Schmausser             local: lan.informatik.tu-muenchen.dbp.de |
|  TU Muenchen, Inst. f. Informatik     DFN: schmauss@{local}                  |
|  Arcisstrasse                        UUCP: schmauss%{local}@unido.uucp       |
|  D-8000 Muenchen                  ARPA/CS: schmauss%{local}@relay.cs.net     |
`------------------------------------------------------------------------------'
Technical Details
Message-ID: <797@infovax.lan.informatik.tu-muenchen.dbp.de>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!unido!ztivax!tumuc!lan!schmauss
References: <587@alice.marlow.uucp> <4048@ttidca.TTI.COM> <960@myrias.UUCP> <24@hcr.UUCP> <4129@ttidca.TTI.COM> <175@hcr.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!lll-winken!uunet!mcvax!unido!ztivax!tumuc!lan!schmauss
From: schmauss@lan.informatik.tu-muenchen.dbp.de (Franz Schmausser)
Newsgroups: comp.editors
Subject: Re: Vi bashing or counting lines
Summary: Counting lines in *vi* is *POSSIBLE* without forking
Message-ID: <797@infovax.lan.informatik.tu-muenchen.dbp.de>
Date: 11 Apr 89 12:17:38 GMT
References: <587@alice.marlow.uucp> <4048@ttidca.TTI.COM> <960@myrias.UUCP> <24@hcr.UUCP> <4129@ttidca.TTI.COM> <175@hcr.UUCP>
Reply-To: schmauss@lan.informatik.tu-muenchen.dbp.de (Franz Schmausser)
Organization: Inst. fuer Informatik, TU Muenchen, W. Germany
Lines: 41