<?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: Scripting Question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674807#M51791</link>
    <description>if [ $(grep -c PAUSE $FILE2) -gt 0 ]&lt;BR /&gt;then&lt;BR /&gt;  grep -v RUNNING $FILE | grep -v PAUSE &amp;gt; $FILE2&lt;BR /&gt;else&lt;BR /&gt;  grep -v RUNNING $FILE &amp;gt; $FILE2&lt;BR /&gt;fi</description>
    <pubDate>Fri, 01 Mar 2002 20:12:54 GMT</pubDate>
    <dc:creator>Alan Riggs</dc:creator>
    <dc:date>2002-03-01T20:12:54Z</dc:date>
    <item>
      <title>Scripting Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674805#M51789</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I am executing java command line arguments to check the status of processes in a korn shell script:&lt;BR /&gt;example:&lt;BR /&gt;java.com.abcdedf check API&lt;BR /&gt;The output on stdout is:&lt;BR /&gt;API1 RUNNING&lt;BR /&gt;API2 RUNNING&lt;BR /&gt;API3 RUNNING&lt;BR /&gt;API4 PAUSE&lt;BR /&gt;.....&lt;BR /&gt;&lt;BR /&gt;I run this in cron every 10 mins and it pages the SAs when the status is other than RUNNING.. One of the APIs let's say API4 goes into a PAUSE status very often and I would like to modify the script to not to email the SA's the first time it goes into PAUSE status but the second time.&lt;BR /&gt;&lt;BR /&gt;Right now everything goes in a file like this&lt;BR /&gt;java.... check API &amp;gt; $FILE&lt;BR /&gt;grep -v RUNNING $FILE &amp;gt; $FILE2&lt;BR /&gt;&lt;BR /&gt;I later check if this file is more than some value then page with the output ...&lt;BR /&gt;&lt;BR /&gt;Any help will be appreciated..&lt;BR /&gt;&lt;BR /&gt;I am not sure If I was clear enough...&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Fri, 01 Mar 2002 19:51:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674805#M51789</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-03-01T19:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674806#M51790</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;One simple solution would be to leverage the count option ('-c') of 'grep' to test if there are more than one instance of your target:&lt;BR /&gt;&lt;BR /&gt;if [ `grep -c "API14 PAUSE" /tmp/file` -gtr 1 ]&lt;BR /&gt;then&lt;BR /&gt;echo "more than one match"&lt;BR /&gt;else&lt;BR /&gt;echo "only one match"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 01 Mar 2002 20:08:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674806#M51790</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2002-03-01T20:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674807#M51791</link>
      <description>if [ $(grep -c PAUSE $FILE2) -gt 0 ]&lt;BR /&gt;then&lt;BR /&gt;  grep -v RUNNING $FILE | grep -v PAUSE &amp;gt; $FILE2&lt;BR /&gt;else&lt;BR /&gt;  grep -v RUNNING $FILE &amp;gt; $FILE2&lt;BR /&gt;fi</description>
      <pubDate>Fri, 01 Mar 2002 20:12:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674807#M51791</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2002-03-01T20:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674808#M51792</link>
      <description>JRF - that would work if he was appending (&amp;gt;&amp;gt;) - but his grep line isn't.&lt;BR /&gt;&lt;BR /&gt;He'd be better off setting a counter when he sees a pause &amp;amp; resetting it when pause disappears - don't you think?&lt;BR /&gt;&lt;BR /&gt;Jeff</description>
      <pubDate>Fri, 01 Mar 2002 20:17:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674808#M51792</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2002-03-01T20:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674809#M51793</link>
      <description>Thanks Guys !&lt;BR /&gt;&lt;BR /&gt;Hi JRF, as Jeff pointed out I am not appending the file ...but I get the idea now... &lt;BR /&gt;&lt;BR /&gt;For now, temporarily I will write to two files and then validate..&lt;BR /&gt;&lt;BR /&gt;If you guys could think about a permanent and efficient way to check this that will be great..&lt;BR /&gt;&lt;BR /&gt;I would like to keep this simple (not too many variables/files)..&lt;BR /&gt;&lt;BR /&gt;Thanks again !&lt;BR /&gt;&lt;BR /&gt;-Shabu</description>
      <pubDate>Fri, 01 Mar 2002 21:54:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674809#M51793</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-03-01T21:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674810#M51794</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;if grep PAUSE /tmp/javaoutput &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;then &lt;BR /&gt;if [ -e /tmp/PAUSED_ONCE ]&lt;BR /&gt;then&lt;BR /&gt;echo "this is the 2nd match, paging out now ..."&lt;BR /&gt;rm -f /tmp/PAUSED_ONCE&lt;BR /&gt;else &lt;BR /&gt;echo "this is only the 1st match" &lt;BR /&gt;touch /tmp/PAUSED_ONCE&lt;BR /&gt;fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Fri, 01 Mar 2002 22:07:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674810#M51794</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2002-03-01T22:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674811#M51795</link>
      <description>Shabu -- if you want a more elegant solution you will have to tell us your "reset condition".  At some point, you undoubtedly want to page again on the first new instance of "PAUSE".  &lt;BR /&gt;</description>
      <pubDate>Fri, 01 Mar 2002 22:37:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674811#M51795</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2002-03-01T22:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Scripting Question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674812#M51796</link>
      <description>&lt;BR /&gt;Thanks Steven !&lt;BR /&gt;&lt;BR /&gt;Nice logic :-) I tweaked it a little bit to not to satisfy the first condition if run from the command prompt and also exported variables instead of touch/rm files. Hope that's okay.&lt;BR /&gt;&lt;BR /&gt;-Shabu</description>
      <pubDate>Fri, 01 Mar 2002 23:40:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-question/m-p/2674812#M51796</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-03-01T23:40:09Z</dc:date>
    </item>
  </channel>
</rss>

