Vi isn't nasty enough, so user looses lines

Richard L. Klappal rlk at chinet.UUCP
Fri Aug 23 17:24:32 AEST 1985


In article <2073 at ukma.UUCP> david at ukma.UUCP (David Herron, NPR Lover) writes:
>Problem: Vi allows users to :wq without comment when they've
>	deleted part of the file and written it to something else.  
>	This can result in lost files and confused novices.
>
>Repeat-by: Edit a file.  Delete part of the file.  (dG)  Write
>	the result to another file (:w junk).  Exit by either
>	typing :wq or ZZ.  Notice that the original is shorter.
>	Find backup tape.
>
>
>Hackin's in me blood.  My mother was known as Miss Hacker before she married!

Not sure I understand the problem!!
ZZ is shorthand for :wq
:wq means write it out & quit
if you don't want to modify the original (and didn't set readonly 
[ -R option ], the correct way to exit is :q! which is quit & discard
changes.

In your example it did EXACTLY what you told it to.



Richard Klappal

UUCP:		..!ihnp4!chinet!uklpl!rlk  | "Money is truthful.  If a man
MCIMail:	rklappal		   | speaks of his honor, make him
Compuserve:	74106,1021		   | pay cash."
USPS:		1 S 299 Danby Street	   | 
		Villa Park IL 60181	   |	Lazarus Long 
TEL:		(312) 620-4988		   |	    (aka R. Heinlein)
-------------------------------------------------------------------------



More information about the Net.bugs mailing list