From owner-freebsd-questions@FreeBSD.ORG Wed Jul 20 04:51:22 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9A34316A41F for ; Wed, 20 Jul 2005 04:51:22 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F46743D46 for ; Wed, 20 Jul 2005 04:51:22 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.13.1/8.13.3) id j6K4pLM8069285; Tue, 19 Jul 2005 23:51:21 -0500 (CDT) (envelope-from dan) Date: Tue, 19 Jul 2005 23:51:21 -0500 From: Dan Nelson To: Xu Qiang Message-ID: <20050720045121.GB94371@dan.emsphone.com> References: <20050720044345.04C111D969@imss.sgp.fujixerox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050720044345.04C111D969@imss.sgp.fujixerox.com> X-OS: FreeBSD 5.4-STABLE X-message-flag: Outlook Error User-Agent: Mutt/1.5.9i Cc: freebsd-questions@freebsd.org Subject: Re: 1 byte more? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2005 04:51:22 -0000 In the last episode (Jul 20), Xu Qiang said: > In FreeBSD 5.3, I want to create a new txt file with vi, and type a > single digit into it, and save it for future use. > > My steps are: > 1 vi count.txt > 2 type i (for insert mode) > 3 type 0 > 4 Esc > 5 :wq > > Then by "ls -l", I found the file's size is 2 bytes, intead of 1 byte > as I expected. vi probably put a newline character after the one you typed. You can use echo -n 0 > count.txt or a text editor that doesn't force a newline as the last character in a file (joe for example). -- Dan Nelson dnelson@allantgroup.com