Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!im4u!milano!peterson From: peterson@milano.UUCP Newsgroups: net.unix Subject: Re: problem with tail -3540 Message-ID: <2399@milano.UUCP> Date: Fri, 19-Sep-86 13:53:19 EDT Article-I.D.: milano.2399 Posted: Fri Sep 19 13:53:19 1986 Date-Received: Sat, 20-Sep-86 02:11:08 EDT References: <917@gilbbs.UUCP> Sender: peterson@milano.UUCP Organization: MCC, Austin, TX Lines: 23 Keywords: tail, pipes, trouble Summary: tail code In article <917@gilbbs.UUCP>, mc68020@gilbbs.UUCP (Thomas J Keller) writes: > > I typed: > > tail -3540 history > newhist > > what I get is the last 72.? lines of history. ... the > output file is *ALWAYS* 4096 bytes in length. If you look at the man page for tail under "Bugs", it says: "Tails relative to the end of the file are treasured up in a buffer, and thus are limited in length" Looking at the code, what that means is that tail allocates a buffer of 4096 bytes and reads the last 4K bytes into it. It then counts lines from the end of the buffer until (1) it has found the desired number of lines or (2) it reaches the front of the buffer. It then prints this part of the buffer. Since the buffer size if 4K, tail will never print more than 4K bytes. -- James Peterson peterson@mcc.com or ...sally!im4u!milano!peterson