[net.unix] problem with tail -3540

mc68020@gilbbs.UUCP (Thomas J Keller) (09/18/86)

   For some reason, expire doesn't trim my history file when it runs.  This
results in a rather largish history file accruing in my lib/news directory
pretty quickly.  I tried to use tail to  trim the head end off of the 
history file and output the result to another file, but it won't work.

I typed:

tail -3540 history > newhist

what I get is the last 72.? lines of history.  Interestingly enough, the
output file is *ALWAYS* 4096 bytes in length.  On my system, that is the
size of a pipe buffer (am I saying that right?).  In any case, I can't see
any reason why this should be the case.

Oh...I am running XENIX 3.0 on a Tandy 6000.

please ***HELP***??????


-- 

Disclaimer:  Disclaimer?  DISCLAIMER!? I don't need no stinking DISCLAIMER!!!

tom keller					"She's alive, ALIVE!"
{ihnp4, dual}!ptsfa!gilbbs!mc68020

(* we may not be big, but we're small! *)

peterson@milano.UUCP (09/19/86)

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

tw@omssw2.UUCP (tom walsh) (09/21/86)

In article <917@gilbbs.UUCP> mc68020@gilbbs.UUCP (Thomas J Keller) writes:
>
>   For some reason, expire doesn't trim my history file when it runs.  This
>results in a rather largish history file accruing in my lib/news directory
>pretty quickly.  I tried to use tail to  trim the head end off of the 
>history file and output the result to another file, but it won't work.
>I typed:
>tail -3540 history > newhist
>what I get is the last 72.? lines of history.  Interestingly enough, the
>output file is *ALWAYS* 4096 bytes in length.  On my system, that is the
>size of a pipe buffer (am I saying that right?).  In any case, I can't see
>any reason why this should be the case.
>Oh...I am running XENIX 3.0 on a Tandy 6000.
>please ***HELP***??????
>Disclaimer:  Disclaimer?  DISCLAIMER!? I don't need no stinking DISCLAIMER!!!
>tom keller					"She's alive, ALIVE!"
>{ihnp4, dual}!ptsfa!gilbbs!mc68020
>(* we may not be big, but we're small! *)

there is an array declared of size 4096.
sorry, but it's not my fault...
-tw
ps: my employer did not cause this either.
pss: there are similar problems with dd and skip/count/bs

    microsoft!\
       ogcvax! \
         reed!  \
     <others>!   >omssw2!tw (i think...)
       omssw1!  /
      intelcs! /
     intelisc!/

..tektronix!ogcvax!omssw1!omssw2!tw