<?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: awk to print last line in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064126#M94450</link>
    <description>Hi Chris:&lt;BR /&gt;&lt;BR /&gt;With Perl that's easy:&lt;BR /&gt;&lt;BR /&gt;# command|perl -nlae 'print $F[0] if eof'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Tue, 21 Aug 2007 07:21:49 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2007-08-21T07:21:49Z</dc:date>
    <item>
      <title>awk to print last line</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064122#M94446</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;how can I get awk to print the last line and first field from a command output?&lt;BR /&gt;&lt;BR /&gt;I know I can do :&lt;BR /&gt;&lt;BR /&gt;command | awk '/rows/ {print $1}'&lt;BR /&gt;&lt;BR /&gt;but I was wondering is there another method incase there are mulitple lines containing rows?&lt;BR /&gt;&lt;BR /&gt;command output is:&lt;BR /&gt;&lt;BR /&gt;USER_NAME       RESPONSIBILITY&lt;BR /&gt;--------------- ------------------------------&lt;BR /&gt;abc&lt;BR /&gt;&lt;BR /&gt;USER_NAME       RESPONSIBILITY&lt;BR /&gt;--------------- ------------------------------&lt;BR /&gt;def&lt;BR /&gt;&lt;BR /&gt;141 rows selected.</description>
      <pubDate>Tue, 21 Aug 2007 07:08:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064122#M94446</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2007-08-21T07:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: awk to print last line</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064123#M94447</link>
      <description>Not sure about awk but I know you can do it with sed:&lt;BR /&gt;&lt;BR /&gt;# print last line of file (emulates "tail -1")&lt;BR /&gt; sed '$!d'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 21 Aug 2007 07:16:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064123#M94447</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2007-08-21T07:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: awk to print last line</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064124#M94448</link>
      <description>super,&lt;BR /&gt;&lt;BR /&gt;that will do me!&lt;BR /&gt;&lt;BR /&gt;Thanks Pete.</description>
      <pubDate>Tue, 21 Aug 2007 07:19:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064124#M94448</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2007-08-21T07:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: awk to print last line</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064125#M94449</link>
      <description># print the last line of a file (emulates "tail -1")&lt;BR /&gt; awk 'END{print}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan</description>
      <pubDate>Tue, 21 Aug 2007 07:21:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064125#M94449</guid>
      <dc:creator>Ivan Krastev</dc:creator>
      <dc:date>2007-08-21T07:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: awk to print last line</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064126#M94450</link>
      <description>Hi Chris:&lt;BR /&gt;&lt;BR /&gt;With Perl that's easy:&lt;BR /&gt;&lt;BR /&gt;# command|perl -nlae 'print $F[0] if eof'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 21 Aug 2007 07:21:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064126#M94450</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-08-21T07:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: awk to print last line</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064127#M94451</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;...I should hasten to add, that if you want the whole last line, simply do:&lt;BR /&gt;&lt;BR /&gt;# command|perl -nle 'print if eof'&lt;BR /&gt;&lt;BR /&gt;...otherwise what I gave above prints the _first_ filed of the _last_ line only.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Aug 2007 07:24:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064127#M94451</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-08-21T07:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: awk to print last line</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064128#M94452</link>
      <description>You could of course use tail then awk.  Or use this script that saves field 1 of the last line:&lt;BR /&gt;command | awk '&lt;BR /&gt;{&lt;BR /&gt;SAVE = $1&lt;BR /&gt;}&lt;BR /&gt;END { print SAVE } '</description>
      <pubDate>Tue, 21 Aug 2007 07:27:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064128#M94452</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-08-21T07:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: awk to print last line</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064129#M94453</link>
      <description>Thats the ticket ....&lt;BR /&gt;&lt;BR /&gt;Thank you everyone.&lt;BR /&gt;&lt;BR /&gt;Chris.</description>
      <pubDate>Tue, 21 Aug 2007 07:29:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064129#M94453</guid>
      <dc:creator>lawrenzo_1</dc:creator>
      <dc:date>2007-08-21T07:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: awk to print last line</title>
      <link>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064130#M94454</link>
      <description>It looks like you can combine Ivan's with mine and get:&lt;BR /&gt;awk 'END { print $1 } '</description>
      <pubDate>Tue, 21 Aug 2007 07:35:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/awk-to-print-last-line/m-p/5064130#M94454</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-08-21T07:35:45Z</dc:date>
    </item>
  </channel>
</rss>

