Re: 1 byte more?

2005-07-20 Thread Gary W. Swearingen
Mac Mason [EMAIL PROTECTED] writes: As I recall, the convention is than UNIX text files should always end with a newline character. I can certainly envision situations where you might not want to have the extra \n, but it makes intuitive sense for it to be there: having the first half of a

1 byte more?

2005-07-19 Thread Xu Qiang
Hi, all: I just met a strange problem. 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,

Re: 1 byte more?

2005-07-19 Thread Dan Nelson
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

RE: 1 byte more?

2005-07-19 Thread Xu Qiang
Dan Nelson wrote: 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). Yes, You hit the point again. I used xemacs to hex edit that file, to find

Re: 1 byte more?

2005-07-19 Thread Mac Mason
On Wed, Jul 20, 2005 at 01:21:10PM +0800, Xu Qiang wrote: I used xemacs to hex edit that file, to find a newline character (0x0a) is added to the txt file, even though I didn't touch the Enter key in my keyboard. Maybe vi is too aggressively helpful. :) As I recall, the convention is than UNIX