<?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: shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2950246#M115778</link>
    <description>$ cat getutil.awk&lt;BR /&gt;BEGIN{}&lt;BR /&gt;{&lt;BR /&gt;if (NR==1) { split($0,disks);getline; }&lt;BR /&gt;if (NR==2) { getline; }&lt;BR /&gt;utilcol=3;&lt;BR /&gt;for (ct=1;ct &amp;lt;= ndisks; ct++)&lt;BR /&gt; {&lt;BR /&gt;  disks[ct,sum] += $utilcol;&lt;BR /&gt;  utilcol += 3;&lt;BR /&gt;  if (utilcol &amp;gt; NF) { break; }&lt;BR /&gt; }&lt;BR /&gt;}END{&lt;BR /&gt;for (ct=1;ct&amp;lt;=ndisks;ct++){&lt;BR /&gt; printf ("%s %f\n", disks[ct], disks[ct,sum]/(NR-2));&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;call as follows -&lt;BR /&gt;&lt;BR /&gt;$ export ndisks=2&lt;BR /&gt;$ iostat -D -l $ndisks 1 4 | awk -f getutil.awk -v ndisks=$ndisks&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;BR /&gt;&lt;BR /&gt;- ramd.</description>
    <pubDate>Mon, 14 Apr 2003 06:54:04 GMT</pubDate>
    <dc:creator>Ramkumar Devanathan</dc:creator>
    <dc:date>2003-04-14T06:54:04Z</dc:date>
    <item>
      <title>shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2950245#M115777</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;    I am not so savy in writing awk scripts .Please guide me to write a script to get the required values.&lt;BR /&gt;The senario is as follows.&lt;BR /&gt;&lt;BR /&gt;   The output of a command (which is the output of the command iostat in solaris) is as follows.&lt;BR /&gt; iostat -D -l 2 1 4&lt;BR /&gt;         sd0           sd6&lt;BR /&gt;rps wps util  rps wps util&lt;BR /&gt;  0   5  3.0    0   0  0.0&lt;BR /&gt;  0   0  0.0    0   0  0.0&lt;BR /&gt;  0   0  0.0    0   0  0.0&lt;BR /&gt;  0   0  0.0    0   0  0.0&lt;BR /&gt;&lt;BR /&gt;Here I need to store the disk names (viz.sd0 and sd1) and also for each disk, the utilization column,i.e the thrid field for each disk needs to added and the average should be taken and to be stored in another variable.Here the disks is not alwas same it depends on the number of disk available on the system.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance,&lt;BR /&gt;Regards,&lt;BR /&gt;Raghu</description>
      <pubDate>Mon, 14 Apr 2003 06:08:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2950245#M115777</guid>
      <dc:creator>Raghu Kanth C.L</dc:creator>
      <dc:date>2003-04-14T06:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2950246#M115778</link>
      <description>$ cat getutil.awk&lt;BR /&gt;BEGIN{}&lt;BR /&gt;{&lt;BR /&gt;if (NR==1) { split($0,disks);getline; }&lt;BR /&gt;if (NR==2) { getline; }&lt;BR /&gt;utilcol=3;&lt;BR /&gt;for (ct=1;ct &amp;lt;= ndisks; ct++)&lt;BR /&gt; {&lt;BR /&gt;  disks[ct,sum] += $utilcol;&lt;BR /&gt;  utilcol += 3;&lt;BR /&gt;  if (utilcol &amp;gt; NF) { break; }&lt;BR /&gt; }&lt;BR /&gt;}END{&lt;BR /&gt;for (ct=1;ct&amp;lt;=ndisks;ct++){&lt;BR /&gt; printf ("%s %f\n", disks[ct], disks[ct,sum]/(NR-2));&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;call as follows -&lt;BR /&gt;&lt;BR /&gt;$ export ndisks=2&lt;BR /&gt;$ iostat -D -l $ndisks 1 4 | awk -f getutil.awk -v ndisks=$ndisks&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;BR /&gt;&lt;BR /&gt;- ramd.</description>
      <pubDate>Mon, 14 Apr 2003 06:54:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-script/m-p/2950246#M115778</guid>
      <dc:creator>Ramkumar Devanathan</dc:creator>
      <dc:date>2003-04-14T06:54:04Z</dc:date>
    </item>
  </channel>
</rss>

