Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bbn!apple!vsi1!wyse!mips!prls!philabs!fafner!rlw From: rlw@fafner.Philips.Com (Richard L. Wexelblat) Newsgroups: comp.misc Subject: Re: Oh boy! I guess it's time for the VI REFERENCE again... Message-ID: <47042@philabs.Philips.Com> Date: 15 Mar 89 15:10:20 GMT References: <12406@dartvax.Dartmouth.EDU> <958@starfish.Convergent.COM> <2386@iscuva.ISCS.COM> <415@corpane.UUCP> <37287@think.UUCP> <2145@solo4.cs.vu.nl> <223@ai.cs.utexas.edu> Sender: news@philabs.Philips.Com Reply-To: rlw@fafner.UUCP (Richard L. Wexelblat) Organization: Philips Laboratories, Briarcliff Manor, NY Lines: 21 >>X:wq | write the file and quit vi > Use of this ex command should be avoided (at least in Sun version 3.7). > The problem is that it attempts to write the buffer and, *regardless > of the success or failure* of that operation, simply quits. > So if you get a "disk full" error, chances are you will find that your > file has been truncated to length zero. > > Since ":x" and "ZZ" are functionally equivalent, but do not exit if > there is a write error, they should be used instead. Actually, there is an obscure bug/feature in at least some versions of vi that can create problems with ZZ. Any :w sets the "file has been saved" bitso the sequence :1,2:w foofle ZZ Will exit vi _without_ saving the file. --Dick Wexelblat rlw@philabs.philips.com uunet!philabs!rlw Philips Labs 914 945 6400