In vi, ZZ is not :wq

Al Filipski al at mot.UUCP
Sat Sep 14 06:53:06 AEST 1985


*
In "Re: Re: Vi isn't nasty enough, so user looses lines", there is the
exchange:
> 
> > ZZ is shorthand for :wq
> > :wq means write it out & quit
> 
> ZZ is shorthand for :x<CR>
> 
ZZ is NOT equivalent to either :wq or :x on our System V.2 vi,
but differs from the latter two (which seem to be equivalent) in
an insidious way. For example, for an existing file foo,

vi foo
<change some things>
:w bar
ZZ

does NOT cause the changes to be written to foo.  However,

vi foo
<change some things>
:w bar
:wq

DOES. ZZ apparently tries to be smart and avoid unnecessary writes,
but I would expect it to write the file being edited in the case 
above. A bug, I'd call it.

--------------------------------
Alan Filipski, UNIX group, Motorola Microsystems, Tempe, AZ U.S.A
{seismo|ihnp4}!ut-sally!oakhill!mot!al
ucbvax!arizona!asuvax!mot!al
--------------------------------



More information about the Net.bugs mailing list