[comp.sys.pyramid] strange behaviour of vi

guy@auspex.auspex.com (Guy Harris) (06/28/90)

>Yes, there is an undocumented feature that will take the first line as
>initial commands.

As others have noted, it's the first 5 lines...

>The password file should be safe since the first line should begin with
>"root:".

...and therefore it's not safe; I remember somebody at Sun being bit by
this "vi" misfeature.

djg@pyrnova (Don Giberson) (06/28/90)

In article <1990Jun25.165806.16769@tubsibr.uucp> 
petri@tubsibr.UUCP (Stefan Petri) writes:

>On our pyramid-clone Nixdorf Targon/35-M50 (TOS3.3, something like OSx4.4,
>...so it seems we got the sysV-Version of vi for both universes
>(also this vi does not recognize resizing of an xterm :-( )

i just messed around with this one yesterday.  thanx to the x guru's here,
it now works, sorta.  [X works better in ucb than att, since that's what it
was written in/for.]

this discussion pertains to the terminfo entry for xterm/xterms from the MIT X
distribution.  xterm is defined as 80 columns by 65 lines; xterms is 80x24.
the ucb termcap responds appropriately to resizing of a window, at worst 
using the `resize' command, at best with your window manager keeping things
happy.  but in the att universe, the window size is fixed at 80x65 or 80x24
(see above).  best suggestion:  use the LINES environment variable after 
resizing your window.  (dunno what'll happen if you use other than 80 columns, 
however!).  then kick off your att vi.

if the targon supports ucb, you might be happier running vi in ucb!

  Don Giberson / Pyramid Technology Corp / djg@pyramid.com / 415-335-8925
  <or>    ...!{allegra,decwrl,hplabs,munnari,sun,uunet,utai}!pyramid!djg
Standard disclaimer, etc. etc.

wht@n4hgf.uucp (Warren Tucker) (06/28/90)

In article <117815@pyramid.pyramid.com> cal@pyrtech.pyramid.com (Craig Alan Levin) writes:
>In article <1990Jun25.165806.16769@tubsibr.uucp> petri@tubsibr.UUCP (Stefan Petri) writes:
>>The `magic pattern' seems to be ``^.*ei:.*:.*''
>Yes, there is an undocumented feature that will take the first line as
>initial commands.  The password file should be safe since the first
>line should begin with "root:".

Actually, the first "few" or last "few,", "few" ~= 5
and the test is for 'e' or 'v' followed by 'x' or 'i'.
ex:
ei:
vi:
vx:
are all canditidates in near the end or beginning of the file,
regardless of whether the string appears at column one or now.
I place
/* vi: set tabwidth=4 shiftwidth=4: */
in all my C source and
; vi: set tabwidth=8 shiftwidth=8:
in assembler
at the -bottom- of the file.

Cheers.
 
---------------------------------------------------------------------
Warren Tucker, TuckerWare  emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
Any perceptible delay will eventually get on your nerves. --Bob Hyers

alex@pta.oz.au (Alex Patison) (06/29/90)

> >>The `magic pattern' is [ve][ix]:

and is a great trap especially when /etc/passwd contains alex: