<?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: Script help needed in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020650#M428463</link>
    <description>Hunki,&lt;BR /&gt;&lt;BR /&gt;Here is an example with the case statement.&lt;BR /&gt;&lt;BR /&gt;#----------------------------------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# An example with the case statement&lt;BR /&gt;# Reads a command from the user and processes it&lt;BR /&gt;echo "Enter your command (who, list, or cal)"&lt;BR /&gt;read command&lt;BR /&gt;case "$command" in&lt;BR /&gt; who)&lt;BR /&gt;  echo "Running who..."&lt;BR /&gt;  who&lt;BR /&gt;  ;;&lt;BR /&gt; list)&lt;BR /&gt;  echo "Running ls..."&lt;BR /&gt;  ls&lt;BR /&gt;  ;;&lt;BR /&gt; cal)&lt;BR /&gt;  echo "Running cal..."&lt;BR /&gt;  cal&lt;BR /&gt;  ;;&lt;BR /&gt; *)&lt;BR /&gt;  echo "Bad command, your choices are: who, list, or cal"&lt;BR /&gt;  ;;&lt;BR /&gt;esac&lt;BR /&gt;exit 0&lt;BR /&gt;#----------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this will help,&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.</description>
    <pubDate>Thu, 28 Dec 2006 16:31:34 GMT</pubDate>
    <dc:creator>Raj D.</dc:creator>
    <dc:date>2006-12-28T16:31:34Z</dc:date>
    <item>
      <title>Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020647#M428460</link>
      <description>Attached is part of a case statement of a script that I have to use to boot up JBOSS on a system.  The thing is I have three instances of JBOSS ( REST-A/B/C ) for starting all three instances in the case statement I have function called check_"instance-name" to see if the instance is already up . &lt;BR /&gt;&lt;BR /&gt;But the problem is if the instance is already up then how to make it switch to the next checking of the instance and then the next one within the case statement so that it does not start duplicate instances.&lt;BR /&gt;&lt;BR /&gt;thanks in anticipation,&lt;BR /&gt;hunki</description>
      <pubDate>Thu, 28 Dec 2006 15:56:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020647#M428460</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-28T15:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020648#M428461</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;One way would be to have a 'while' loop that runs until a maximum count of running objects is tallied by the 'case'.  &lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 28 Dec 2006 16:10:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020648#M428461</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-12-28T16:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020649#M428462</link>
      <description>I dont get it ... can u show me within the script on how to do it please. &lt;BR /&gt;&lt;BR /&gt;thanks,</description>
      <pubDate>Thu, 28 Dec 2006 16:12:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020649#M428462</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-28T16:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020650#M428463</link>
      <description>Hunki,&lt;BR /&gt;&lt;BR /&gt;Here is an example with the case statement.&lt;BR /&gt;&lt;BR /&gt;#----------------------------------------&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;# An example with the case statement&lt;BR /&gt;# Reads a command from the user and processes it&lt;BR /&gt;echo "Enter your command (who, list, or cal)"&lt;BR /&gt;read command&lt;BR /&gt;case "$command" in&lt;BR /&gt; who)&lt;BR /&gt;  echo "Running who..."&lt;BR /&gt;  who&lt;BR /&gt;  ;;&lt;BR /&gt; list)&lt;BR /&gt;  echo "Running ls..."&lt;BR /&gt;  ls&lt;BR /&gt;  ;;&lt;BR /&gt; cal)&lt;BR /&gt;  echo "Running cal..."&lt;BR /&gt;  cal&lt;BR /&gt;  ;;&lt;BR /&gt; *)&lt;BR /&gt;  echo "Bad command, your choices are: who, list, or cal"&lt;BR /&gt;  ;;&lt;BR /&gt;esac&lt;BR /&gt;exit 0&lt;BR /&gt;#----------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this will help,&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.</description>
      <pubDate>Thu, 28 Dec 2006 16:31:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020650#M428463</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2006-12-28T16:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020651#M428464</link>
      <description>read my question raj ...</description>
      <pubDate>Thu, 28 Dec 2006 16:36:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020651#M428464</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-28T16:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020652#M428465</link>
      <description>How about extending your decision statement for example:&lt;BR /&gt;&lt;BR /&gt;check_REST-A &amp;amp;&amp;amp; echo "JBoss - REST-A already running!" ||&lt;BR /&gt;(&lt;BR /&gt;echo "Starting JBOSS-A";&lt;BR /&gt;su - gt -c "nohup /export/home/tmp/mc/jboss-4.0.4.GA/bin/run.sh -c REST-A";&lt;BR /&gt;echo "Server startup may take a while - "&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;~hope it helps</description>
      <pubDate>Thu, 28 Dec 2006 16:50:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020652#M428465</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2006-12-28T16:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020653#M428466</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Consider something like this:&lt;BR /&gt;&lt;BR /&gt;# cat ./looper&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset -l REPLY&lt;BR /&gt;typeset    FLAG_A=0&lt;BR /&gt;typeset    FLAG_B=0&lt;BR /&gt;typeset    FLAG_C=0&lt;BR /&gt;while true &lt;BR /&gt;do&lt;BR /&gt;    echo "please respond..."&lt;BR /&gt;    read   REPLY&lt;BR /&gt;    case ${REPLY} in&lt;BR /&gt;    "a" )&lt;BR /&gt;        [ ${FLAG_A} = 1 ] &amp;amp;&amp;amp; echo "already done" || FLAG_A=1&lt;BR /&gt;    ;;&lt;BR /&gt;    "b" )&lt;BR /&gt;        [ ${FLAG_B} = 1 ] &amp;amp;&amp;amp; echo "already done" || FLAG_B=1&lt;BR /&gt;    ;;&lt;BR /&gt;    "c" )&lt;BR /&gt;        [ ${FLAG_C} = 1 ] &amp;amp;&amp;amp; echo "already done" || FLAG_C=1&lt;BR /&gt;    ;;&lt;BR /&gt;    esac&lt;BR /&gt;&lt;BR /&gt;    [ ${FLAG_A} = 1 -a ${FLAG_B} = 1 -a ${FLAG_C} = 1 ] &amp;amp;&amp;amp; break&lt;BR /&gt;done&lt;BR /&gt;echo "done!"&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;...When executed, this script will run forever until it receives an "a", "b" or "c" set of responses.  Duplicate responses are ignored.  Input can be upper or lower case.&lt;BR /&gt;&lt;BR /&gt;In the absence of a blocking I/O like a 'read' in this script, add a 'sleep' to the loop so that you do not needlessly consume the CPU.&lt;BR /&gt; &lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 28 Dec 2006 17:07:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020653#M428466</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-12-28T17:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020654#M428467</link>
      <description>Sorry for not misunderstanding the question! &lt;BR /&gt;&lt;BR /&gt;To check the next checking of the instance after the first check , hope you can use decission making and flow control with " if then  else" loop , what do you think.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.&lt;BR /&gt;</description>
      <pubDate>Thu, 28 Dec 2006 17:43:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020654#M428467</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2006-12-28T17:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020655#M428468</link>
      <description>Pls eliminate "not" in my last post.&lt;BR /&gt;&lt;BR /&gt;P.S: "0" point pls. Thx.</description>
      <pubDate>Thu, 28 Dec 2006 17:45:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020655#M428468</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2006-12-28T17:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020656#M428469</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Use for loop&lt;BR /&gt;&lt;BR /&gt;eg.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for Instance in REST-A REST-b REST-C&lt;BR /&gt;do&lt;BR /&gt;  check_${Instance} &amp;amp;&amp;amp; echo "Already UP ${Instance}"&lt;BR /&gt;  ..&lt;BR /&gt;  .. &lt;UR additional="" code=""&gt;&lt;BR /&gt;  ..&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-Santosh&lt;/UR&gt;</description>
      <pubDate>Fri, 29 Dec 2006 04:31:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020656#M428469</guid>
      <dc:creator>SANTOSH S. MHASKAR</dc:creator>
      <dc:date>2006-12-29T04:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020657#M428470</link>
      <description>Thanks Sandman and thanks also to James, Raj , Santosh for replying.</description>
      <pubDate>Fri, 29 Dec 2006 11:24:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020657#M428470</guid>
      <dc:creator>Hunki</dc:creator>
      <dc:date>2006-12-29T11:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Script help needed</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020658#M428471</link>
      <description>Btw, Hunki did you got any solution, and would you like to share as how this is resolved.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Raj.</description>
      <pubDate>Fri, 29 Dec 2006 20:01:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-needed/m-p/5020658#M428471</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2006-12-29T20:01:25Z</dc:date>
    </item>
  </channel>
</rss>

