<?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: Nested if statement help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/nested-if-statement-help/m-p/2813059#M84820</link>
    <description>How about sprucing it up a little?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;remsh $host -n 'ps -ef | grep uq | grep -v grep'&lt;BR /&gt;errchk=$?&lt;BR /&gt;#&lt;BR /&gt;this_host=$(hostname)&lt;BR /&gt;title="remote print from $this_host to $QUEUE@$host via $host_path user $user"&lt;BR /&gt;command="np -q$QUEUE -boff $form $font $opts -T'$title' $name"&lt;BR /&gt;#&lt;BR /&gt;# did remsh work?&lt;BR /&gt;#&lt;BR /&gt;if [[ $errchk != 0 ]]&lt;BR /&gt;then&lt;BR /&gt;command="remsh $host -l remprt $command"&lt;BR /&gt;output=$($command 2&amp;gt;&amp;amp;1)&lt;BR /&gt;status=$?&lt;BR /&gt;else&lt;BR /&gt;command="remsh $host -l remprt '. /usr/UniQ/print/setup;$command'"&lt;BR /&gt;output=$($command 2&amp;gt;&amp;amp;1)&lt;BR /&gt;status=$?&lt;BR /&gt;fi&lt;BR /&gt;#&lt;BR /&gt;# check error status&lt;BR /&gt;#&lt;BR /&gt;if [[ $status != 0 ]]&lt;BR /&gt;then&lt;BR /&gt;ERROR="MSG: remprt failed [$status]\nCOMMAND: $command\nOUTPUT: $output"&lt;BR /&gt;error_routine&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
    <pubDate>Wed, 25 Sep 2002 11:31:01 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2002-09-25T11:31:01Z</dc:date>
    <item>
      <title>Nested if statement help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nested-if-statement-help/m-p/2813057#M84818</link>
      <description>Hi everyone.&lt;BR /&gt;&lt;BR /&gt;Currently implementing UniQ , upgrade from openspool. Problem is when attempting to remsh and pass print to another server that may or may not be running UniQ&lt;BR /&gt;&lt;BR /&gt;Usual scenario , I have to ammend a script written some time ago in a galaxy.......&lt;BR /&gt;&lt;BR /&gt;I need to check the status of an error code before performing a set of commands. I need then to perform an action depending on the status code of the last command etc etc&lt;BR /&gt;&lt;BR /&gt;Have a look and see if you can see what is wrong with what I have up to now&lt;BR /&gt;&lt;BR /&gt;# Check to see if the host is running UniQ&lt;BR /&gt;&lt;BR /&gt;remsh $host -n 'ps -ef | grep uq | grep -v grep'&lt;BR /&gt;&lt;BR /&gt;if [[ $? != 0 ]]&lt;BR /&gt;then&lt;BR /&gt;this_host=$(hostname)&lt;BR /&gt;title="remote print from $this_host to $QUEUE@$host via $host_path user $user"&lt;BR /&gt;command="np -q$QUEUE -boff $form $font $opts -T'$title' $name"&lt;BR /&gt;command="remsh $host -l remprt $command"&lt;BR /&gt;output=$($command 2&amp;gt;&amp;amp;1)&lt;BR /&gt;status=$?&lt;BR /&gt;        if [[ $status != 0 ]]&lt;BR /&gt;                then&lt;BR /&gt;        ERROR="MSG: remprt failed [$status]\nCOMMAND: $command\nOUTPUT: $output"&lt;BR /&gt;                                        error_routine&lt;BR /&gt;        fi&lt;BR /&gt;&lt;BR /&gt;# If the host is running UniQ then source the setup&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;&lt;BR /&gt;this_host=$(hostname)&lt;BR /&gt;title="remote print from $this_host to $QUEUE@$host via $host_path user $user"&lt;BR /&gt;command="np -q$QUEUE -boff $form $font $opts -T'$title' $name"&lt;BR /&gt;command="remsh $host -l remprt '. /usr/UniQ/print/setup;$command'&lt;BR /&gt;output=$($command 2&amp;gt;&amp;amp;1)&lt;BR /&gt;status=$?&lt;BR /&gt;        if [[ $status != 0 ]]&lt;BR /&gt;        then&lt;BR /&gt;        ERROR="MSG: remprt failed [$status]\nCOMMAND: $command\nOUTPUT: $output"&lt;BR /&gt;                error_routine&lt;BR /&gt;&lt;BR /&gt;        fi&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Any help appreciated. Thanks in advance &lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Sep 2002 11:13:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nested-if-statement-help/m-p/2813057#M84818</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-09-25T11:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if statement help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nested-if-statement-help/m-p/2813058#M84819</link>
      <description>&lt;BR /&gt;You are missing an ENDING quote (") on this line:&lt;BR /&gt;&lt;BR /&gt;command="remsh $host -l remprt '. /usr/UniQ/print/setup;$command'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Wed, 25 Sep 2002 11:22:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nested-if-statement-help/m-p/2813058#M84819</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-09-25T11:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if statement help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nested-if-statement-help/m-p/2813059#M84820</link>
      <description>How about sprucing it up a little?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;remsh $host -n 'ps -ef | grep uq | grep -v grep'&lt;BR /&gt;errchk=$?&lt;BR /&gt;#&lt;BR /&gt;this_host=$(hostname)&lt;BR /&gt;title="remote print from $this_host to $QUEUE@$host via $host_path user $user"&lt;BR /&gt;command="np -q$QUEUE -boff $form $font $opts -T'$title' $name"&lt;BR /&gt;#&lt;BR /&gt;# did remsh work?&lt;BR /&gt;#&lt;BR /&gt;if [[ $errchk != 0 ]]&lt;BR /&gt;then&lt;BR /&gt;command="remsh $host -l remprt $command"&lt;BR /&gt;output=$($command 2&amp;gt;&amp;amp;1)&lt;BR /&gt;status=$?&lt;BR /&gt;else&lt;BR /&gt;command="remsh $host -l remprt '. /usr/UniQ/print/setup;$command'"&lt;BR /&gt;output=$($command 2&amp;gt;&amp;amp;1)&lt;BR /&gt;status=$?&lt;BR /&gt;fi&lt;BR /&gt;#&lt;BR /&gt;# check error status&lt;BR /&gt;#&lt;BR /&gt;if [[ $status != 0 ]]&lt;BR /&gt;then&lt;BR /&gt;ERROR="MSG: remprt failed [$status]\nCOMMAND: $command\nOUTPUT: $output"&lt;BR /&gt;error_routine&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry&lt;BR /&gt;</description>
      <pubDate>Wed, 25 Sep 2002 11:31:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nested-if-statement-help/m-p/2813059#M84820</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-09-25T11:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if statement help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nested-if-statement-help/m-p/2813060#M84821</link>
      <description>Harry&lt;BR /&gt;&lt;BR /&gt;Thanks for spotting that mate. Really appreciated&lt;BR /&gt;&lt;BR /&gt;Thanks again&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Wed, 25 Sep 2002 11:36:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nested-if-statement-help/m-p/2813060#M84821</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-09-25T11:36:38Z</dc:date>
    </item>
  </channel>
</rss>

