This is a discussion on paste multiple lines with sun vi within the Sun Solaris Administration forums, part of the Solaris Operating System category; --> I was convinced this was a moment of retardation at first. The machines are all solaris 10, various updates ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I was convinced this was a moment of retardation at first. 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 It only pasted one line. Tried a bunch of other machines, no dice. Had another person try the same task, they failed as well and were like WTF is going on here. Talked to the programmers, they only use vim, where this does work. I come from a BSD world, where vi is really nvi, and this works just fine. Is there a reason this pretty basic behavior doens't work on the sun standard vi, or is there something that would make it not work? |
| |||
| 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. 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. 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'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 -- Do NOT reply via e-mail. Reply in the newsgroup. |
| |||
| 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 |
| |||
| On Sun, 9 Mar 2008, Greg Andrews wrote: > 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. Given that vi's original author, Bill Joy, was one of Sun's founders, I suspect the latter is very probably the case. ;-) -- Rich Teer, SCSA, SCNA, SCSECA, OGB member CEO, My Online Home Inventory URLs: http://www.rite-group.com/rich http://www.linkedin.com/in/richteer http://www.myonlinehomeinventory.com |
| |||
| Rich Teer <rich.teer@rite-group.com> writes: >On Sun, 9 Mar 2008, Greg Andrews wrote: > >> 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. > >Given that vi's original author, Bill Joy, was one of Sun's founders, I >suspect the latter is very probably the case. ;-) > True, though I found an August 1984 magazine interview where he said at that point he'd been away from vi development for 4 or 5 years. Also, I remember that in SunOS 4.1.3 vi was one of the very few apps that used the SysV terminfo system rather than termcap. Made adding new terminal types a PITA. So he might have had less influence on the version of vi in Solaris than his stature as a company founder would imply. It's hard to tell. -Greg -- Do NOT reply via e-mail. Reply in the newsgroup. |
| |||
| Greg Andrews wrote: > Rich Teer <rich.teer@rite-group.com> writes: > >>On Sun, 9 Mar 2008, Greg Andrews wrote: >> >> >>>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. >> >>Given that vi's original author, Bill Joy, was one of Sun's founders, I >>suspect the latter is very probably the case. ;-) >> > > > True, though I found an August 1984 magazine interview where he said > at that point he'd been away from vi development for 4 or 5 years. > Also, I remember that in SunOS 4.1.3 vi was one of the very few apps > that used the SysV terminfo system rather than termcap. Made adding > new terminal types a PITA. > > So he might have had less influence on the version of vi in Solaris > than his stature as a company founder would imply. It's hard to tell. > > -Greg The guy who is running the company generally does not have the time or the energy to do the grunt work as well. By the time you have ten employees, supervising them is generally a full time job. |
| ||||
| In article <Pine.SOL.4.64.0803100711430.17600@marrakesh> Rich Teer <rich.teer@rite-group.com> writes: >On Sun, 9 Mar 2008, Greg Andrews wrote: > >> 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. > >Given that vi's original author, Bill Joy, was one of Sun's founders, I >suspect the latter is very probably the case. ;-) > >-- >Rich Teer, SCSA, SCNA, SCSECA, OGB member > >CEO, >My Online Home Inventory > >URLs: http://www.rite-group.com/rich > http://www.linkedin.com/in/richteer > http://www.myonlinehomeinventory.com Back in my SVR3 days (on AT&T 3B2's no less), I did some digging into issues with vi and xterm on SunOS 4 and SVR3. If you recall, in an xterm on SunOS 4, vi would save and then restore the xterm window on exit. Bringing the xterms terminfo entry over to SVR3 on the 3B2's caused this to not work quite right -- the window would be restored, but the cursor would be left in the upper left hand corner of the xterm window. Digging further, I found that the SVR3 vi had a screen handling bug -- it would home the cursor before it sent the "start of cursor motion" (smkx) sequence. We had a source license, and I found and fixed the problem in my own local copy of vi (long since gone along with the 3B2's). IIRC, it was just moving a line or two of code and then compiling. Guess what? The vi on Solaris 8 and 10 still has this bug. From running vi inside of a script session: Script started on Thu Mar 13 10:02:28 2008 /tmp>vi foo^M ^[[24;1H^[[?1h^[="foo" [Read only] 1 line, 256 characters See, vi homes the cursor (^[[24;1H) and then send the smkx sequence (^[[?1h^[=). This is backwards. I'd say that the vi on Solaris has at SOME System 5 vi code in it. And this also explains why the xterm windows are no longer restored on exiting from vi -- the fix was to remove the save and restore sequences from smkx and rmkx. Maybe I should open a bug report with Sun :-). The fix is likely very trivial. -- Jeff Wieland |
| Thread Tools | |
| Display Modes | |
|
|