<?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: Sum values in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144249#M453239</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# ls -lt | awk 'END{printf "sum=%-3.0f\n",SUM};{SUM+=$5;print $5}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Tue, 02 Dec 2008 15:10:41 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2008-12-02T15:10:41Z</dc:date>
    <item>
      <title>Sum values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144247#M453237</link>
      <description>Dear friends&lt;BR /&gt;&lt;BR /&gt;Simple and stupid question:&lt;BR /&gt;&lt;BR /&gt;I need to sum values of some files placed in  some directory. I use awk to get values like exemple:&lt;BR /&gt;&lt;BR /&gt;# ls -lt avbmon* | awk '{ print $5 }'&lt;BR /&gt;13628&lt;BR /&gt;13413&lt;BR /&gt;13413&lt;BR /&gt;13413&lt;BR /&gt;&lt;BR /&gt;Now i have values, but i need obtain total. I try "sum" command, but i don't have succes with sintax. Can anyone help me? Thanks</description>
      <pubDate>Tue, 02 Dec 2008 15:02:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144247#M453237</guid>
      <dc:creator>Wagner_17</dc:creator>
      <dc:date>2008-12-02T15:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144248#M453238</link>
      <description>awk can sum the numbers for you. Look at &lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1218175" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1218175&lt;/A&gt;</description>
      <pubDate>Tue, 02 Dec 2008 15:08:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144248#M453238</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2008-12-02T15:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144249#M453239</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;# ls -lt | awk 'END{printf "sum=%-3.0f\n",SUM};{SUM+=$5;print $5}'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 02 Dec 2008 15:10:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144249#M453239</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-12-02T15:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144250#M453240</link>
      <description>To obtain in MB values is just to divide by 1024 like below, right?&lt;BR /&gt;&lt;BR /&gt;ls -lt avbmon* | awk 'END{printf "sum=%-3.0f\n",SUM};{SUM+=$5 /1024;print $5 }'&lt;BR /&gt;13628&lt;BR /&gt;13413&lt;BR /&gt;13413&lt;BR /&gt;13413&lt;BR /&gt;sum=53&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Dec 2008 15:16:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144250#M453240</guid>
      <dc:creator>Wagner_17</dc:creator>
      <dc:date>2008-12-02T15:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144251#M453241</link>
      <description>&amp;gt;&amp;gt; To obtain in MB values is just to divide by 1024 like below, right?&lt;BR /&gt;&lt;BR /&gt;That would be KB.&lt;BR /&gt;For MB divide by 1024*1024 ( 1048576 )&lt;BR /&gt;&lt;BR /&gt;Also, it is typically best to divide the sum, not the individual components.&lt;BR /&gt;Higher precision, and Fewer division (does not matter here). &lt;BR /&gt;&lt;BR /&gt;If you only want the sum of the size, then drop the time sort order from -lt.&lt;BR /&gt;&lt;BR /&gt;try:&lt;BR /&gt;ls -l avbmon* | awk 'END{printf "sum=%-3.0f\n",SUM/1048576};{SUM+=$5;print $5 }'&lt;BR /&gt;&lt;BR /&gt;Hein&lt;BR /&gt;</description>
      <pubDate>Tue, 02 Dec 2008 15:24:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144251#M453241</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-12-02T15:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144252#M453242</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;To get MB, do:&lt;BR /&gt;&lt;BR /&gt;# ls -lt avbmon* | awk 'END{printf "sum=%-3.2f\n",SUM/1024/1024};{SUM+=$5;print $5}'&lt;BR /&gt;&lt;BR /&gt;...keep the precision as long as you can.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 02 Dec 2008 15:25:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144252#M453242</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-12-02T15:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sum values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144253#M453243</link>
      <description>Thanks to all!!!</description>
      <pubDate>Tue, 02 Dec 2008 15:42:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sum-values/m-p/5144253#M453243</guid>
      <dc:creator>Wagner_17</dc:creator>
      <dc:date>2008-12-02T15:42:24Z</dc:date>
    </item>
  </channel>
</rss>

