<?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: while loop count or found process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379373#M684779</link>
    <description>That is good, so what if I want to add a comment that i either ended because process was found or I ended because my loop hit 10...&lt;BR /&gt;I always get "waited too log exiting"&lt;BR /&gt;&lt;BR /&gt;(( count=10 ))&lt;BR /&gt;while ((count -=1))&lt;BR /&gt;do&lt;BR /&gt;        if [[ $MQSTAT -eq 1 ]]&lt;BR /&gt;        then&lt;BR /&gt;        break&lt;BR /&gt;        fi&lt;BR /&gt;sleep 5&lt;BR /&gt;mqstatus&lt;BR /&gt;echo $MQSTAT &amp;gt;&amp;gt;test.log&lt;BR /&gt;done&lt;BR /&gt;echo "waited too log exiting" &amp;gt;&amp;gt;test.log</description>
    <pubDate>Sun, 15 Mar 2009 10:20:22 GMT</pubDate>
    <dc:creator>Ratzie</dc:creator>
    <dc:date>2009-03-15T10:20:22Z</dc:date>
    <item>
      <title>while loop count or found process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379371#M684777</link>
      <description>I have a while look that currently checks for process running.&lt;BR /&gt;while [[ $MQSTAT -eq 0 ]]&lt;BR /&gt;  do&lt;BR /&gt;      sleep 30&lt;BR /&gt;      mqstatus&lt;BR /&gt;      echo $MQSTAT &amp;gt;&amp;gt; $SSLOG&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What i want to do is prevent this to go endless if a process never stops.&lt;BR /&gt;How do I as a count.&lt;BR /&gt;So it will exit, if $MQSTAT -eq 0&lt;BR /&gt;or a count after 10 loops exits it.</description>
      <pubDate>Sun, 15 Mar 2009 03:22:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379371#M684777</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2009-03-15T03:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: while loop count or found process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379372#M684778</link>
      <description>&lt;P&gt;You can add a count:&lt;BR /&gt;(( count = 10 ))&lt;BR /&gt;while (( count -= 1)); do&lt;BR /&gt;...&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if [ $MQSTAT -eq 0 ]; then&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fi&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sleep 30&lt;BR /&gt;done&lt;/P&gt;</description>
      <pubDate>Sun, 04 Sep 2011 05:06:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379372#M684778</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-04T05:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: while loop count or found process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379373#M684779</link>
      <description>That is good, so what if I want to add a comment that i either ended because process was found or I ended because my loop hit 10...&lt;BR /&gt;I always get "waited too log exiting"&lt;BR /&gt;&lt;BR /&gt;(( count=10 ))&lt;BR /&gt;while ((count -=1))&lt;BR /&gt;do&lt;BR /&gt;        if [[ $MQSTAT -eq 1 ]]&lt;BR /&gt;        then&lt;BR /&gt;        break&lt;BR /&gt;        fi&lt;BR /&gt;sleep 5&lt;BR /&gt;mqstatus&lt;BR /&gt;echo $MQSTAT &amp;gt;&amp;gt;test.log&lt;BR /&gt;done&lt;BR /&gt;echo "waited too log exiting" &amp;gt;&amp;gt;test.log</description>
      <pubDate>Sun, 15 Mar 2009 10:20:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379373#M684779</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2009-03-15T10:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: while loop count or found process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379374#M684780</link>
      <description>well presumably MQSTAT will still be set, so you could do this messy approach:&lt;BR /&gt;&lt;BR /&gt;(( count=10 ))&lt;BR /&gt;while ((count -=1))&lt;BR /&gt;do&lt;BR /&gt;if [[ $MQSTAT -eq 1 ]]&lt;BR /&gt;then&lt;BR /&gt;echo "MQSTAT = 1" &amp;gt;&amp;gt; test.log&lt;BR /&gt;break&lt;BR /&gt;fi&lt;BR /&gt;sleep 5&lt;BR /&gt;mqstatus&lt;BR /&gt;echo $MQSTAT &amp;gt;&amp;gt;test.log&lt;BR /&gt;done&lt;BR /&gt;[[ $MQSTAT -eq 1 ]] || echo "waited too log exiting" &amp;gt;&amp;gt;test.log&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Sun, 15 Mar 2009 11:53:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379374#M684780</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2009-03-15T11:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: while loop count or found process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379375#M684781</link>
      <description>Just test for 'count' after the loop.&lt;BR /&gt;If it is 0, then the loop count was exhausted, else the process was gone.&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 15 Mar 2009 14:30:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/while-loop-count-or-found-process/m-p/4379375#M684781</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-03-15T14:30:28Z</dc:date>
    </item>
  </channel>
</rss>

