bin/53288: tail will sometimes display more lines than it is told

Friedemann Becker Friedemann.Becker at student.uni-tuebingen.de
Thu Dec 25 11:50:08 PST 2003


The following reply was made to PR bin/53288; it has been noted by GNATS.

From: Friedemann Becker <Friedemann.Becker at student.uni-tuebingen.de>
To: freebsd-gnats-submit at FreeBSD.org, hburch at lumeta.com
Cc:  
Subject: Re: bin/53288: tail will sometimes display more lines than it is
 told
Date: Thu, 25 Dec 2003 20:48:03 +0100

 in How-To-Repeat it should be
 
 while [ 1 ]; do echo test; done > file
 
 and
 
 for i in `jot 1000 1`; do tail file | wc -l; done > linecnt
 
 
 (
  - freebsd uses jot, seq is gnu and if you install it via the port 
 /usr/ports/misc/sh-utils you have to invoke it with 'gseq'
  - semikolon before done
 )
 
 
 I have got an easy workaround for it:
 
 if a file is written to (or could be) while you want to 'tail' it, just 
 do an
 cat file | tail
 that gives tail a snapshot of the file and the results of the above test 
 are correct.
 
 but someone should document this in man1/tail.1
 
 


More information about the freebsd-bugs mailing list