<?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 scripts error help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567014#M872392</link>
    <description>Why i can't use if &lt;VAR&gt; = &lt;SOMETHING&gt; command to compare the output ?? Check below scripts. Thanks.&lt;BR /&gt;============================================&lt;BR /&gt;if $server eq "Started" then&lt;BR /&gt;   echo "OK"&lt;BR /&gt;fi&lt;BR /&gt;&lt;/SOMETHING&gt;&lt;/VAR&gt;</description>
    <pubDate>Mon, 20 Aug 2001 06:01:49 GMT</pubDate>
    <dc:creator>Kenn Chen</dc:creator>
    <dc:date>2001-08-20T06:01:49Z</dc:date>
    <item>
      <title>scripts error help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567014#M872392</link>
      <description>Why i can't use if &lt;VAR&gt; = &lt;SOMETHING&gt; command to compare the output ?? Check below scripts. Thanks.&lt;BR /&gt;============================================&lt;BR /&gt;if $server eq "Started" then&lt;BR /&gt;   echo "OK"&lt;BR /&gt;fi&lt;BR /&gt;&lt;/SOMETHING&gt;&lt;/VAR&gt;</description>
      <pubDate>Mon, 20 Aug 2001 06:01:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567014#M872392</guid>
      <dc:creator>Kenn Chen</dc:creator>
      <dc:date>2001-08-20T06:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: scripts error help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567015#M872393</link>
      <description>&lt;BR /&gt;To do a test is must be inside square brackets;&lt;BR /&gt;&lt;BR /&gt;if [ "$server" = "Started" ] &lt;BR /&gt;then&lt;BR /&gt;  echo OK&lt;BR /&gt;else&lt;BR /&gt;  echo NO&lt;BR /&gt;fi&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Aug 2001 06:14:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567015#M872393</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2001-08-20T06:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: scripts error help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567016#M872394</link>
      <description>Hi&lt;BR /&gt;  For string comparision you have to use quotes&lt;BR /&gt;&lt;BR /&gt;if [ "$A" = "String" ];then&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;...BPK...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Aug 2001 06:57:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567016#M872394</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2001-08-20T06:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: scripts error help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567017#M872395</link>
      <description>Hi Idris,&lt;BR /&gt;this is depending in which case you wan?t to use this script. for your simple case &lt;BR /&gt;if ["$server" = "started"]&lt;BR /&gt;then&lt;BR /&gt;echo ok&lt;BR /&gt;else&lt;BR /&gt;if ["$server" = ""]&lt;BR /&gt;echo nostatus&lt;BR /&gt;else&lt;BR /&gt;NO&lt;BR /&gt;fi&lt;BR /&gt;fi</description>
      <pubDate>Mon, 20 Aug 2001 07:02:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567017#M872395</guid>
      <dc:creator>AlHassani Mohamed</dc:creator>
      <dc:date>2001-08-20T07:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: scripts error help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567018#M872396</link>
      <description>The objet after the "if" must return a value:&lt;BR /&gt; =0 --&amp;gt; OK (true)&lt;BR /&gt;&amp;lt;&amp;gt;0 --&amp;gt; FAIL (false)&lt;BR /&gt;&lt;BR /&gt;Long time ago, the "test" command was used (see manual pages of test command).&lt;BR /&gt;&lt;BR /&gt;if test $X -eq $Y ???&lt;BR /&gt;&lt;BR /&gt;Now shells have got buit-in this command and uses alternate notation (the braket).&lt;BR /&gt;&lt;BR /&gt;if [ $X = $Y ] ???&lt;BR /&gt;&lt;BR /&gt;If you use double brackets the notation for some operators as AND, OR, ... has changed. See the following example:&lt;BR /&gt;&lt;BR /&gt;if [ $X = 3 -a $Y = 2 ] ???&lt;BR /&gt;&lt;BR /&gt;if [[ $X = 3 &amp;amp;&amp;amp; $Y = 2 ]] ???</description>
      <pubDate>Mon, 20 Aug 2001 07:03:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567018#M872396</guid>
      <dc:creator>Jdamian</dc:creator>
      <dc:date>2001-08-20T07:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: scripts error help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567019#M872397</link>
      <description>Further to everything above, I think it is worth explaining the difference between = &amp;amp; -eq;&lt;BR /&gt;&lt;BR /&gt;-eq is Numerical equals e.g &lt;BR /&gt;if [ $var -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;.....&lt;BR /&gt;&lt;BR /&gt;= is equivalent ASCII e.g.&lt;BR /&gt;if [ $var = hello ]&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt;there is a similar distinction between &lt;BR /&gt;-lt &amp;amp; &amp;lt;&lt;BR /&gt;-gt &amp;amp; &amp;gt;&lt;BR /&gt;-le &amp;amp; &amp;lt;=&lt;BR /&gt;-ge &amp;amp; &amp;gt;=&lt;BR /&gt;but obviously seeing if a character is greater than an ASCII character is less intuative&lt;BR /&gt;&lt;BR /&gt;You can get all the above from man ksh...&lt;BR /&gt;&lt;BR /&gt;Tim&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Aug 2001 08:47:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567019#M872397</guid>
      <dc:creator>Tim D Fulford</dc:creator>
      <dc:date>2001-08-20T08:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: scripts error help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567020#M872398</link>
      <description>There are two correct methods, see man test&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Aug 2001 16:42:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripts-error-help/m-p/2567020#M872398</guid>
      <dc:creator>Fred Martin_1</dc:creator>
      <dc:date>2001-08-20T16:42:43Z</dc:date>
    </item>
  </channel>
</rss>

