Xref: utzoo comp.misc:5449 comp.editors:529 Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!meyering From: meyering@cs.utexas.edu (Jim Meyering) Newsgroups: comp.misc,comp.editors Subject: Re: Oh boy! I guess it's time for the VI REFERENCE again... Summary: Don't use EX command ":wq"! Message-ID: <223@ai.cs.utexas.edu> Date: 11 Mar 89 19:10:00 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> Followup-To: comp.misc Organization: U. Texas CS Dept., Austin, Texas Lines: 17 In article <2145@solo4.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: [description of vi commands deleted] >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. -- --- Jim Meyering meyering@cs.utexas.edu