<?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: compare script question  .. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686409#M54285</link>
    <description>Hey everyone thanks for your help .. Here is what I decided to go with .. &lt;BR /&gt;&lt;BR /&gt;grep duration /usr/informix/online.log | grep -v Fuzzy | awk ' $6 &amp;gt; 15 {printf "&lt;BR /&gt;There is a long checkpoint of %s\n",$6}' &lt;BR /&gt;grep duration /usr/informix/online.log | grep -v Fuzzy | awk ' $6 &amp;gt; 15 ' | read &lt;BR /&gt;numb&lt;BR /&gt;grep "$numb" /usr/informix/online.log&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Gives me &lt;BR /&gt;&lt;BR /&gt;There is a long checkpoint of 17&lt;BR /&gt;08:20:57  Checkpoint Completed:  duration was 17 seconds.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Richard&lt;BR /&gt;</description>
    <pubDate>Tue, 19 Mar 2002 20:48:24 GMT</pubDate>
    <dc:creator>someone_4</dc:creator>
    <dc:date>2002-03-19T20:48:24Z</dc:date>
    <item>
      <title>compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686402#M54278</link>
      <description>Hello everyone .. I have this out put from online.log:&lt;BR /&gt;&lt;BR /&gt;04:49:08  Checkpoint Completed:  duration was 1 seconds.&lt;BR /&gt;04:49:12  Checkpoint Completed:  duration was 0 seconds.&lt;BR /&gt;04:56:13  Checkpoint Completed:  duration was 0 seconds.&lt;BR /&gt;08:20:57  Checkpoint Completed:  duration was 17 seconds.&lt;BR /&gt;08:21:30  Checkpoint Completed:  duration was 0 seconds.&lt;BR /&gt;14:51:00  Checkpoint Completed:  duration was 4 seconds.&lt;BR /&gt;14:51:25  Checkpoint Completed:  duration was 0 seconds.&lt;BR /&gt;&lt;BR /&gt;The objective is to get the number of seconds and warn me if at any time they are greater then 15. Here is what I got so far ..&lt;BR /&gt;&lt;BR /&gt;grep duration /usr/informix/online.log | grep -v Fuzzy | awk '{print $6}'&lt;BR /&gt;&lt;BR /&gt;gives me &lt;BR /&gt;&lt;BR /&gt;1&lt;BR /&gt;0&lt;BR /&gt;0&lt;BR /&gt;17&lt;BR /&gt;0&lt;BR /&gt;4&lt;BR /&gt;0&lt;BR /&gt;&lt;BR /&gt;That gives me just the lines above and then only gives me the seconds .. &lt;BR /&gt;&lt;BR /&gt;So then I tried&lt;BR /&gt;&lt;BR /&gt;grep duration /usr/informix/online.log | grep -v Fuzzy | awk '{print $6}'| read numb&lt;BR /&gt;&lt;BR /&gt;if [ $numb -gt 15 ]&lt;BR /&gt;then &lt;BR /&gt;echo "You have long checkpoints"&lt;BR /&gt;else&lt;BR /&gt;echo " Everything is fine"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But that does not work for me. For somereason I cant feed the line of numbers to my test if statement. What Am I missing? I know its simple ..&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Tue, 19 Mar 2002 20:18:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686402#M54278</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2002-03-19T20:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686403#M54279</link>
      <description>#!/usr/bin/ksh&lt;BR /&gt;grep duration /tmp/online.log | grep -v Fuzzy | awk '{print $6}'| sort -rn| whil&lt;BR /&gt;e read numb&lt;BR /&gt;do&lt;BR /&gt;echo $numb&lt;BR /&gt;if [ $numb -gt 15 ]&lt;BR /&gt;then&lt;BR /&gt;echo "You have long checkpoints"&lt;BR /&gt;else&lt;BR /&gt;echo " Everything is fine"&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;note I sorted the list in reverse numerical order.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 19 Mar 2002 20:26:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686403#M54279</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-03-19T20:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686404#M54280</link>
      <description>of course grep can nail them also:&lt;BR /&gt;&lt;BR /&gt;grep duration /tmp/online.log | grep -v Fuzzy | awk '{print $6}'| grep "[0-9][0-9]"&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 19 Mar 2002 20:33:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686404#M54280</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-03-19T20:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686405#M54281</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Your script is not working because you missed "while" before the read&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;awk '/duration/{print $6}' test | while read NUM; do&lt;BR /&gt;if [[ ${NUM} -gt "15" ]]; then&lt;BR /&gt; echo "you have long checkpoints"&lt;BR /&gt;else&lt;BR /&gt; echo "okay"&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;-Shabu</description>
      <pubDate>Tue, 19 Mar 2002 20:34:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686405#M54281</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-03-19T20:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686406#M54282</link>
      <description># perl -ne '/Fuzzy/ or /duration.*?(\d+)/ &amp;amp;&amp;amp; $1 &amp;gt; 15 &amp;amp;&amp;amp; print' online.log</description>
      <pubDate>Tue, 19 Mar 2002 20:34:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686406#M54282</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-03-19T20:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686407#M54283</link>
      <description>grep duration /usr/informix/online.log | grep -v Fuzzy | awk ' $6 &amp;gt; 15 {printf "There is a long checkpoint of %s\n",$6}' &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Mar 2002 20:35:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686407#M54283</guid>
      <dc:creator>Krishna Prasad</dc:creator>
      <dc:date>2002-03-19T20:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686408#M54284</link>
      <description>I like procura's, but I'd modify RON's and display the entire line so you know when it happened!&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 19 Mar 2002 20:37:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686408#M54284</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-03-19T20:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686409#M54285</link>
      <description>Hey everyone thanks for your help .. Here is what I decided to go with .. &lt;BR /&gt;&lt;BR /&gt;grep duration /usr/informix/online.log | grep -v Fuzzy | awk ' $6 &amp;gt; 15 {printf "&lt;BR /&gt;There is a long checkpoint of %s\n",$6}' &lt;BR /&gt;grep duration /usr/informix/online.log | grep -v Fuzzy | awk ' $6 &amp;gt; 15 ' | read &lt;BR /&gt;numb&lt;BR /&gt;grep "$numb" /usr/informix/online.log&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Gives me &lt;BR /&gt;&lt;BR /&gt;There is a long checkpoint of 17&lt;BR /&gt;08:20:57  Checkpoint Completed:  duration was 17 seconds.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Richard&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Mar 2002 20:48:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686409#M54285</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2002-03-19T20:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686410#M54286</link>
      <description>procura your solution if very nice .. I like it. My friend who loves perl will enjoy that. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Tue, 19 Mar 2002 20:51:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686410#M54286</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2002-03-19T20:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686411#M54287</link>
      <description>Richard,&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;grep duration /tmp/online.log | grep -v Fuzzy | awk '$6 &amp;gt; 15 {printf "There is a&lt;BR /&gt; long checkpoint of %s\n",$6;printf "%s\n",$0;}'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;will find all the lines and print their corresponding line. The solution you gave will report the same FULL-LINE if TWO or MORE TIMES are &amp;gt; 15 and equal&lt;BR /&gt;&lt;BR /&gt;line these two lines:&lt;BR /&gt;04:49:08 Checkpoint Completed: duration was 1 seconds.&lt;BR /&gt;04:49:12 Checkpoint Completed: duration was 0 seconds.&lt;BR /&gt;04:56:13 Checkpoint Completed: duration was 0 seconds.&lt;BR /&gt;08:20:57 Checkpoint Completed: duration was 17 seconds.&lt;BR /&gt;08:21:30 Checkpoint Completed: duration was 0 seconds.&lt;BR /&gt;14:51:00 Checkpoint Completed: duration was 4 seconds.&lt;BR /&gt;14:51:25 Checkpoint Completed: duration was 17 seconds.&lt;BR /&gt;&lt;BR /&gt;yours will display :&lt;BR /&gt;&lt;BR /&gt;08:20:57 Checkpoint Completed: duration was 17 seconds.&lt;BR /&gt;&lt;BR /&gt;TWICE, when it should display:&lt;BR /&gt;&lt;BR /&gt;08:20:57 Checkpoint Completed: duration was 17 seconds.&lt;BR /&gt;14:51:25 Checkpoint Completed: duration was 17 seconds.&lt;BR /&gt;&lt;BR /&gt;give my modifications to your solution a zip&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 19 Mar 2002 20:59:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686411#M54287</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-03-19T20:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686412#M54288</link>
      <description>wow .. that was good .. &lt;BR /&gt;Would you mind breaking it down for me? I understand everything up to the printf .. &lt;BR /&gt;&lt;BR /&gt;of %s\n",$6;printf "%s\n",$0;}'&lt;BR /&gt;&lt;BR /&gt;is the part I dont understand. What I do somewhat understand is that you are printing the output There is a long checkpoint with the $6 (6th row) which is what gives us :&lt;BR /&gt;&lt;BR /&gt;There is a long checkpoint of 17&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;grep duration /usr/informix/online.log | grep -v Fuzzy | awk '$6 &amp;gt; 15 {printf "T&lt;BR /&gt;here is a long checkpoint of %s\n",$6;printf "%s\n",$0;}'&lt;BR /&gt;&lt;BR /&gt;And just wondering how long have you been writting scripts? It seems that it is 2nd nature to you. Did you read books or just learned as you did. &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Richard</description>
      <pubDate>Tue, 19 Mar 2002 21:09:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686412#M54288</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2002-03-19T21:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686413#M54289</link>
      <description>Richard,&lt;BR /&gt;&lt;BR /&gt;Both, but first by fire. 12years ago I ported banking software from a Honeywell to an AIX box and I had to learn unix and learn it quick. I've been a developer for EON'S (24 years now).&lt;BR /&gt;&lt;BR /&gt;Here:&lt;BR /&gt;&lt;BR /&gt;grep duration /tmp/online.log | grep -v Fuzzy |&lt;BR /&gt;awk '$6 &amp;gt; 15 {printf "There is a&lt;BR /&gt;long checkpoint of %s\n",$6;&lt;BR /&gt;printf "%s\n",$0;}' &lt;BR /&gt;&lt;BR /&gt;The line:&lt;BR /&gt;awk '$6 &amp;gt; 15 {printf "There is a long checkpoint of %s\n",$6;&lt;BR /&gt;&lt;BR /&gt;like Ron suggested matches when the 6th value on the line is greater than 15, then the BODY of the AWK script kicks in:&lt;BR /&gt;&lt;BR /&gt;{printf "There is a long checkpoint of %s\n",$6;&lt;BR /&gt;printf "%s\n",$0;}'&lt;BR /&gt;&lt;BR /&gt;The lines in AWK are seperated by ";'s" and $0 is the whole line. Printf's are about the same in perl, C, and Awk.&lt;BR /&gt;&lt;BR /&gt;And will you please learn perl? hehehe&lt;BR /&gt;&lt;BR /&gt;Live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 19 Mar 2002 21:20:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686413#M54289</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-03-19T21:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686414#M54290</link>
      <description>lol&lt;BR /&gt;thanks harry .. And I am working on learning perl seems to be a pretty cool code. I have SAMS Teach yourself perl in 24 hours. To me it was full of fluff. I am thinking thats why I got burnt out on Perl. But I am willing to try again. Any better books out there?&lt;BR /&gt;&lt;BR /&gt;Richard</description>
      <pubDate>Tue, 19 Mar 2002 21:29:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686414#M54290</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2002-03-19T21:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686415#M54291</link>
      <description>Richard, &lt;BR /&gt;&lt;BR /&gt;being a techno-geek I like the O'reilly books as reference manuals. There are a lot good web sites with good crap, hell, I' a cut and paster!!&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.perlmonks.org/" target="_blank"&gt;http://www.perlmonks.org/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.planet-source-code.com/vb/default.asp?lngWId=6#categories" target="_blank"&gt;http://www.planet-source-code.com/vb/default.asp?lngWId=6#categories&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.perlnow.com/" target="_blank"&gt;http://www.perlnow.com/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.perl.com/CPAN-local/scripts/" target="_blank"&gt;http://www.perl.com/CPAN-local/scripts/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://use.perl.org/" target="_blank"&gt;http://use.perl.org/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.sysadminmag.com/tpj/" target="_blank"&gt;http://www.sysadminmag.com/tpj/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.perl.org/" target="_blank"&gt;http://www.perl.org/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www-genome.wi.mit.edu/WWW/examples/Ch9/" target="_blank"&gt;http://www-genome.wi.mit.edu/WWW/examples/Ch9/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and at least a few thousand more!&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Mar 2002 00:25:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686415#M54291</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-03-20T00:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: compare script question  ..</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686416#M54292</link>
      <description>And be sure to install at least perl-5.6.1 (some people on this forum still use 4.036 :)&lt;BR /&gt;&lt;BR /&gt;That way I'll be sure my answers will work as expected.</description>
      <pubDate>Wed, 20 Mar 2002 07:30:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/compare-script-question/m-p/2686416#M54292</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-03-20T07:30:29Z</dc:date>
    </item>
  </channel>
</rss>

