View Single Post

   
  #3 (permalink)  
Old 03-17-2008, 06:04 AM
Cydrome Leader
 
Posts: n/a
Default Re: paste multiple lines with sun vi

Greg Andrews <gerg@panix.com> wrote:
> Cydrome Leader <presence@MUNGEpanix.com> writes:
>>
>>The machines are all solaris 10, various updates and various hardware.
>>Mission was to copy and paste a line in vi say 500 times. I tried the
>>usual yy, to copy the line I wanted, then 500p
>>

>
> IIRC, Sun's vi, like /bin/sh, traces its ancestry back to the version
> provided in AT&T's SRV4 Unix almost 20 years ago (1989). Since the
> SVR4 blend of BSD and System V Unixes was a joint project by AT&T and
> Sun (and others), the Solaris vi might even go all the way back to the
> original version created at Berkeley in the late 70s.


that might be. I wish I had a running AT&T SV machine to test this on.

> Occaisionally, I've noticed some inconsistencies in how the Solaris vi
> handles count/repeat prefixes among the different commands. I just figured
> they were things from the original code that Sun never enhanced.


Pasting single characters with repeat seems ok. The odd part is not that
repeat pasting of lines doesn't work, but that I haven't noticed it until
now.

> I think the few times I've needed to replicate a single line in this way,
> I did some manual yanking and pasting ('p' ten times, then '10yy' and 'p'
> ten times, then '100yy' and 'p' 5 times). Or wrote a shell loop to append
> the line to the file 500 times.


I usually just hit p or . as many times as I need, and a few is usually
enough- it's never been hundreds before.

> I've looked through my old O'Reilly nutshell handbook on vi and found
> a couple of potential ways to do it with ex commands, but I don't have a
> way to test them at the moment.
>
> -Greg

Reply With Quote