<?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: test on decimal value + awk in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510194#M705394</link>
    <description>I agree with Peter. The following line is wrong&lt;BR /&gt;&lt;BR /&gt;$12 &amp;gt;= $PCPU&lt;BR /&gt;&lt;BR /&gt;Right one should be:&lt;BR /&gt;&lt;BR /&gt;$12 &amp;gt;= PCPU&lt;BR /&gt;&lt;BR /&gt;My own script should be:&lt;BR /&gt;&lt;BR /&gt;awk '&lt;BR /&gt;BEGIN {&lt;BR /&gt;printf("PID\tUser\tTime\tCPU\tCommand\n")&lt;BR /&gt;OFMT="%.6g"&lt;BR /&gt;PCPU=1.0&lt;BR /&gt;OFS="\t"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$12 &amp;gt;= PCPU { print $3,$4,$10,$12,$13 }&lt;BR /&gt;' /tmp/topfile</description>
    <pubDate>Wed, 23 Mar 2005 08:47:22 GMT</pubDate>
    <dc:creator>Jdamian</dc:creator>
    <dc:date>2005-03-23T08:47:22Z</dc:date>
    <item>
      <title>test on decimal value + awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510189#M705389</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I did a script to get top process with high CPU. I want to do a test with value 1.0 but I do not know how to do correctly the test :&lt;BR /&gt;&lt;BR /&gt;awk '&lt;BR /&gt;BEGIN {&lt;BR /&gt; printf("PID\tUser\tTime\tCPU\tCommand\t\n")&lt;BR /&gt;       }&lt;BR /&gt;&lt;BR /&gt;BEGIN {&lt;BR /&gt;      OFMT="%.6g"&lt;BR /&gt;      PCPU=1.0&lt;BR /&gt;      while ("cat /tmp/topfile" | getline )&lt;BR /&gt;        {if ($12 &amp;gt;= $PCPU)&lt;BR /&gt;     {OFS="\t"; print $3,$4,$10,$12,$13}&lt;BR /&gt;  }&lt;BR /&gt;       }&lt;BR /&gt;&lt;BR /&gt;but I get :&lt;BR /&gt;PID     User    Time    CPU     Command &lt;BR /&gt;20333   appe11t 187:16  3.61    java&lt;BR /&gt;16006   root    0:23    0.93    top&lt;BR /&gt;25825   appe11t 152:30  0.30    java&lt;BR /&gt;21858   orae11t 0:00    0.76    oracleE11T&lt;BR /&gt;21558   appe11t 10:21   0.48    java&lt;BR /&gt;19392   appp11t 14:32   0.33    java&lt;BR /&gt;19390   appp11t 18:41   0.65    java&lt;BR /&gt;18558   orae11t 0:00    1.66    oracleE11T&lt;BR /&gt;&lt;BR /&gt;thanks for help&lt;BR /&gt;&lt;BR /&gt;Laurent</description>
      <pubDate>Wed, 23 Mar 2005 05:16:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510189#M705389</guid>
      <dc:creator>MR VILLOT   MR MONTAGNE</dc:creator>
      <dc:date>2005-03-23T05:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: test on decimal value + awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510190#M705390</link>
      <description>Laurent,&lt;BR /&gt;have tried replacing &amp;gt;= with -ge&lt;BR /&gt;Regards</description>
      <pubDate>Wed, 23 Mar 2005 05:24:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510190#M705390</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-03-23T05:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: test on decimal value + awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510191#M705391</link>
      <description>Laurent,&lt;BR /&gt;sorry, my previous was wrong answer.&lt;BR /&gt;&lt;BR /&gt;Please replace the $PCPU with PCPU in the if statement.&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Mar 2005 05:37:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510191#M705391</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-03-23T05:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: test on decimal value + awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510192#M705392</link>
      <description>Peter,&lt;BR /&gt;&lt;BR /&gt;what is the difference between $PCPU and PCPU in my condition ?&lt;BR /&gt;test on character value and numeric value.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Laurent</description>
      <pubDate>Wed, 23 Mar 2005 06:53:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510192#M705392</guid>
      <dc:creator>MR VILLOT   MR MONTAGNE</dc:creator>
      <dc:date>2005-03-23T06:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: test on decimal value + awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510193#M705393</link>
      <description>Laurent,&lt;BR /&gt;it might help with testing to add before the if statement:&lt;BR /&gt;&lt;BR /&gt;OFS="|";print $12,$PCPU,PCPU&lt;BR /&gt;&lt;BR /&gt;You can then see the $PCPU has null value, whereas PCPU has the correct value.&lt;BR /&gt;&lt;BR /&gt;Also be aware that you are comparing numbers, so 1.0 becomes 1 for the comparisons.&lt;BR /&gt;&lt;BR /&gt;Hope this makes it clearer.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Mar 2005 07:33:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510193#M705393</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2005-03-23T07:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: test on decimal value + awk</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510194#M705394</link>
      <description>I agree with Peter. The following line is wrong&lt;BR /&gt;&lt;BR /&gt;$12 &amp;gt;= $PCPU&lt;BR /&gt;&lt;BR /&gt;Right one should be:&lt;BR /&gt;&lt;BR /&gt;$12 &amp;gt;= PCPU&lt;BR /&gt;&lt;BR /&gt;My own script should be:&lt;BR /&gt;&lt;BR /&gt;awk '&lt;BR /&gt;BEGIN {&lt;BR /&gt;printf("PID\tUser\tTime\tCPU\tCommand\n")&lt;BR /&gt;OFMT="%.6g"&lt;BR /&gt;PCPU=1.0&lt;BR /&gt;OFS="\t"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$12 &amp;gt;= PCPU { print $3,$4,$10,$12,$13 }&lt;BR /&gt;' /tmp/topfile</description>
      <pubDate>Wed, 23 Mar 2005 08:47:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/test-on-decimal-value-awk/m-p/3510194#M705394</guid>
      <dc:creator>Jdamian</dc:creator>
      <dc:date>2005-03-23T08:47:22Z</dc:date>
    </item>
  </channel>
</rss>

