<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: broken tail? tail -559 works.  tail -561 fails. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890027#M402178</link>
    <description>The solution would be to do make tail work from the top of the file rather than the end of file, which is the default. You could use:&lt;BR /&gt;tail -n +&lt;START line=""&gt; &lt;FILE name=""&gt;&lt;BR /&gt;&lt;BR /&gt;With "tail -n &amp;lt;# lines&amp;gt; &lt;FILENAME&gt;", the tail would break on any # of lines, depending on the size of the file and the number of lines you are trying to do tail on. "559" is in case of your file with 850 lines. I encountered the problem at 1024 lines for a file with 2000+ lines, 210 lines for a file with 550+ lines etc.&lt;BR /&gt;&lt;/FILENAME&gt;&lt;/FILE&gt;&lt;/START&gt;</description>
    <pubDate>Wed, 25 Jan 2006 14:38:07 GMT</pubDate>
    <dc:creator>Murali K Sethuraman</dc:creator>
    <dc:date>2006-01-25T14:38:07Z</dc:date>
    <item>
      <title>broken tail? tail -559 works.  tail -561 fails.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890023#M402174</link>
      <description>I have a simple text log file.&lt;BR /&gt;I want to truncate the log.&lt;BR /&gt;&lt;BR /&gt;logfile is 850 lines long. &lt;BR /&gt;cat logfile | tail -559 &amp;gt; logfile.tmp&lt;BR /&gt;logfile.tmp should be 559 lines long. And it is.&lt;BR /&gt;&lt;BR /&gt;cat logfile  | tail -561 &amp;gt; logfile.tmp&lt;BR /&gt;logfile.tmp should be 561 lines long.  It is still only 559 lines. &lt;BR /&gt;&lt;BR /&gt;cat logfile | tail -2000 &amp;gt; logfile.tmp&lt;BR /&gt;logfile.tmp should be 850 lines long (i.e. unmodified).  Yet it has been truncated to 559 lines.  &lt;BR /&gt;&lt;BR /&gt;cat logfile | se -e :a -e '$q:N,2001,$D;ba' &amp;gt; logfile.tmp.&lt;BR /&gt;This logfile.tmp is correct.  But I don't understand the strange sed syntax.  I just pulled it off the net.  I don't trust it because I don't understand it.&lt;BR /&gt;&lt;BR /&gt;So my question:&lt;BR /&gt;Any idea why "tail -559 works" and "tail -561" fails?   It this is some type of memory limitation, why does that strange sed command work?&lt;BR /&gt;&lt;BR /&gt;K570 HP9000 HPUX11.0&lt;BR /&gt;&lt;BR /&gt;steve</description>
      <pubDate>Mon, 07 Mar 2005 14:26:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890023#M402174</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2005-03-07T14:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: broken tail? tail -559 works.  tail -561 fails.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890024#M402175</link>
      <description>Depending upon the flavor of UNIX there is a fixed-size buffer for tail operations relative to EOF. Typically it's a 20K buffer.&lt;BR /&gt;&lt;BR /&gt;If you are uncomfortable with the sed command then craft a Perl or awk equivalent.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Mar 2005 14:32:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890024#M402175</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-03-07T14:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: broken tail? tail -559 works.  tail -561 fails.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890025#M402176</link>
      <description>Steve,&lt;BR /&gt;&lt;BR /&gt;From the man page:&lt;BR /&gt;&lt;BR /&gt;"Tails relative to end-of-file are stored in a 20-Kbyte buffer, and  thus are limited in length."&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 07 Mar 2005 14:38:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890025#M402176</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-03-07T14:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: broken tail? tail -559 works.  tail -561 fails.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890026#M402177</link>
      <description>Thanks.  That makes sense.&lt;BR /&gt;&lt;BR /&gt;I ran &lt;BR /&gt;tail -n 580 logfile &amp;gt; f1&lt;BR /&gt;tail -n 590 logfile &amp;gt; f2&lt;BR /&gt;tail -n 200000 logfile &amp;gt; f3&lt;BR /&gt;ls -l f?&lt;BR /&gt;&lt;BR /&gt;I see the file size for files f1, f2 and f3 are ALL 20468 bytes. &lt;BR /&gt;&lt;BR /&gt;#LEN=total lines of logfile&lt;BR /&gt;&lt;BR /&gt;#TAILN=the total I want it to be&lt;BR /&gt;&lt;BR /&gt;#L=the starting line for the awk. &lt;BR /&gt;&lt;BR /&gt;LEN=`wc -l logfile | cut -f1 -d\ `&lt;BR /&gt;TAILN=800&lt;BR /&gt;L=`expr $LEN - $TAILN`&lt;BR /&gt;if [ $L -le 0 ] ; then&lt;BR /&gt;cat logfile&lt;BR /&gt;else&lt;BR /&gt;cat logfile | \&lt;BR /&gt;   awk -v L=$L '// { if (NR &amp;lt; L) print ;}' &amp;gt; f4&lt;BR /&gt;&lt;BR /&gt;File f4 is 28420 bytes, and 800 lines long.&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Mar 2005 16:26:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890026#M402177</guid>
      <dc:creator>Steve Post</dc:creator>
      <dc:date>2005-03-07T16:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: broken tail? tail -559 works.  tail -561 fails.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890027#M402178</link>
      <description>The solution would be to do make tail work from the top of the file rather than the end of file, which is the default. You could use:&lt;BR /&gt;tail -n +&lt;START line=""&gt; &lt;FILE name=""&gt;&lt;BR /&gt;&lt;BR /&gt;With "tail -n &amp;lt;# lines&amp;gt; &lt;FILENAME&gt;", the tail would break on any # of lines, depending on the size of the file and the number of lines you are trying to do tail on. "559" is in case of your file with 850 lines. I encountered the problem at 1024 lines for a file with 2000+ lines, 210 lines for a file with 550+ lines etc.&lt;BR /&gt;&lt;/FILENAME&gt;&lt;/FILE&gt;&lt;/START&gt;</description>
      <pubDate>Wed, 25 Jan 2006 14:38:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890027#M402178</guid>
      <dc:creator>Murali K Sethuraman</dc:creator>
      <dc:date>2006-01-25T14:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: broken tail? tail -559 works.  tail -561 fails.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890028#M402179</link>
      <description>In 11i v1 tail is broke. PHCO_27138 will fix the broken tail command.</description>
      <pubDate>Thu, 26 Jan 2006 11:12:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-tail-tail-559-works-tail-561-fails/m-p/4890028#M402179</guid>
      <dc:creator>Pat Obrien_1</dc:creator>
      <dc:date>2006-01-26T11:12:53Z</dc:date>
    </item>
  </channel>
</rss>

