<?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: parsing output with AWK in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704597#M902541</link>
    <description>Hi lz,&lt;BR /&gt;&lt;BR /&gt;Here is a combination of mine and JRF's ... easy and efficient ...&lt;BR /&gt;&lt;BR /&gt;awk '{t1=t1+$2;t2=t2+$3;t3=t3+$3;t4=t4+$4;} END {print "Total: ", t1,t2,t3,t4}' testfile&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
    <pubDate>Tue, 16 Apr 2002 17:05:15 GMT</pubDate>
    <dc:creator>SHABU KHAN</dc:creator>
    <dc:date>2002-04-16T17:05:15Z</dc:date>
    <item>
      <title>parsing output with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704592#M902536</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Suppose, I have the following information:&lt;BR /&gt;                 total   used    free   avail&lt;BR /&gt;/dev/vg00/lvol3 155648   45189  103603 2402&lt;BR /&gt;/dev/vg00/lvol1  99669   36453   53249 16081 &lt;BR /&gt;/dev/vg00/lvol8  819200  710685  10199 19967&lt;BR /&gt;/dev/vg00/lvol7  819200  496611  30248 18973&lt;BR /&gt;&lt;BR /&gt;I would like to summarize total size of all the above columns: &lt;BR /&gt;e.g.&lt;BR /&gt;                 total   used    free   avail&lt;BR /&gt;/dev/vg00/lvol3 155648   45189  103603 2402&lt;BR /&gt;/dev/vg00/lvol1  99669   36453   53249 16081 &lt;BR /&gt;/dev/vg00/lvol8  819200  710685  10199 19967&lt;BR /&gt;/dev/vg00/lvol7  819200  496611  30248 18973&lt;BR /&gt;&lt;BR /&gt;Total:           199999   88392   82883  2811&lt;BR /&gt;&lt;BR /&gt;Does anyone know the easiest to do it in awk?&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Tue, 16 Apr 2002 16:45:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704592#M902536</guid>
      <dc:creator>andi_1</dc:creator>
      <dc:date>2002-04-16T16:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: parsing output with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704593#M902537</link>
      <description>Hi Harry&lt;BR /&gt;This user has&lt;BR /&gt;assign point to 53 out of 123 answer. &lt;BR /&gt;&lt;BR /&gt;LZ i guss you want to total of all used available and used right?&lt;BR /&gt;&lt;BR /&gt;Run following command in one line.&lt;BR /&gt;#dbf -l | sort | awk '{t+=$2} {u+=$3} {a+=$4} END {print "\n total = "t " used  = u "available = " a}'&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Tue, 16 Apr 2002 16:54:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704593#M902537</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-04-16T16:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: parsing output with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704594#M902538</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Crudely and simply:&lt;BR /&gt;&lt;BR /&gt;# awk '{F2=F2+$2;F3=F3+$3;F4=F4+$4;F5=F5+$5};END {print F2,F3,F4,F5}' /tmp/input&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 16 Apr 2002 16:57:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704594#M902538</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-04-16T16:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: parsing output with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704595#M902539</link>
      <description>lz,&lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;awk '{t1+=$2} END {print "Total: ", t1}' testfile&lt;BR /&gt;&lt;BR /&gt;Will give you the total for the 2nd Column ...&lt;BR /&gt;&lt;BR /&gt;Do the same thing for the other columns ...&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Tue, 16 Apr 2002 16:58:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704595#M902539</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-04-16T16:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: parsing output with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704596#M902540</link>
      <description>Here is what I do in script to get free space on ts* disks.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt; bdf -l &amp;gt; file1&lt;BR /&gt;SPACE=`cat file1 | grep -v used | grep ts | sort | awk -v s=0 '{s+=$4} {v=s/1000000} END {print v}'`&lt;BR /&gt;echo "Free space = ${SPACE}"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Sachin</description>
      <pubDate>Tue, 16 Apr 2002 17:02:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704596#M902540</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-04-16T17:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: parsing output with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704597#M902541</link>
      <description>Hi lz,&lt;BR /&gt;&lt;BR /&gt;Here is a combination of mine and JRF's ... easy and efficient ...&lt;BR /&gt;&lt;BR /&gt;awk '{t1=t1+$2;t2=t2+$3;t3=t3+$3;t4=t4+$4;} END {print "Total: ", t1,t2,t3,t4}' testfile&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Tue, 16 Apr 2002 17:05:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704597#M902541</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-04-16T17:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: parsing output with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704598#M902542</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;For grins-and-giggles, we could also tally the fields into an array (which might be more suitable for situations involving larger numbers of fields):&lt;BR /&gt;&lt;BR /&gt;# awk 'BEGIN{min=2;max=5};{for (i=min;i&amp;lt;=max;i++) a[i]+=$i};END {for (i=min;i&amp;lt;=max;i++) print a[i]}' /tmp/data&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 16 Apr 2002 17:14:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704598#M902542</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-04-16T17:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: parsing output with AWK</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704599#M902543</link>
      <description>install di from &lt;A href="http://www.gentoo.com/di/" target="_blank"&gt;http://www.gentoo.com/di/&lt;/A&gt; and use the -t option&lt;BR /&gt;&lt;BR /&gt;Filesystem         Mount               Megs     Used    Avail %used fs Type&lt;BR /&gt;/dev/vg00/lvol3    /                  200.0     29.2    160.2  20%  vxfs&lt;BR /&gt;/dev/vg00/data     /data             2000.0    613.4   1300.4  35%  vxfs&lt;BR /&gt;/dev/vg00/home     /home               16.0      1.1     14.0  13%  vxfs&lt;BR /&gt;/dev/vg00/opt      /opt               768.0    549.4    204.9  73%  vxfs&lt;BR /&gt;/dev/vg00/pro      /pro             12000.0  11287.1    690.7  94%  vxfs&lt;BR /&gt;/dev/vg00/lvol1    /stand             292.1     31.3    231.6  21%  hfs&lt;BR /&gt;/dev/vg00/tmp      /tmp               400.0    233.5    156.7  61%  vxfs&lt;BR /&gt;/dev/vg00/u        /u                1000.0    373.1    587.7  41%  vxfs&lt;BR /&gt;/dev/vg00/lvol7    /usr              1304.0    616.2    644.9  51%  vxfs&lt;BR /&gt;/dev/vg00/var      /var               504.0    137.5    345.4  31%  vxfs&lt;BR /&gt;/dev/vg00/wrk      /wrk              1000.0     59.8    881.7  12%  vxfs&lt;BR /&gt;                   Total            19484.1  13931.6   5218.3  73%&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Apr 2002 17:16:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/parsing-output-with-awk/m-p/2704599#M902543</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-04-16T17:16:58Z</dc:date>
    </item>
  </channel>
</rss>

