<?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: if statement comparing two digit value against single digit value in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521069#M219924</link>
    <description>I use this for reference:&lt;BR /&gt;&lt;BR /&gt;Testing Numeric Values&lt;BR /&gt;n1 -eq n2 --n1 equals n2&lt;BR /&gt;n1 -ge n2 --n1 is greater than or equal to n2&lt;BR /&gt;n1 -gt n2 --n1 is greater than n2&lt;BR /&gt;n1 -le n2 --n1 is less than or equal to n2&lt;BR /&gt;n1 -lt n2 --n1 is less than n2&lt;BR /&gt;n1 -ne n2 --n1 does not equal n2&lt;BR /&gt;&lt;BR /&gt;String Conditions&lt;BR /&gt;-n s1 --string s1 has non-zero length&lt;BR /&gt;-z s1 --string s1 has zero length&lt;BR /&gt;s1 = s2 --strings s1 and s2 are identical.  In Korn shell, s2 can be a regular expression.&lt;BR /&gt;s1 != s2 --strings s1 and s2 are not identical.  In Korn shell, s2 can be a regular expression&lt;BR /&gt;s1 &amp;lt; s2 --ASCII value of s1 precedes that of s2  (valid only within [[]] construct)  (K)&lt;BR /&gt;s1 &amp;gt; s2 --ASCII value of s1 follows that of s2  (valid only within [[]] construct)  (K)&lt;BR /&gt;</description>
    <pubDate>Fri, 08 Apr 2005 11:52:43 GMT</pubDate>
    <dc:creator>Robert Bennett_3</dc:creator>
    <dc:date>2005-04-08T11:52:43Z</dc:date>
    <item>
      <title>if statement comparing two digit value against single digit value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521065#M219920</link>
      <description>Okay, this to me sounds like a rediculous question, but i am writing a script using if statements.  I define the variable at the top and then "if [[ $TEST &amp;gt; 5 ]]... The script runs but if the value compared against 5 is two-digits (20 for example) or more, it says the value is not greater than 5.  Now I know I can preceed the 5 with 000s as place-holders, but again if the the value exceeds the number of place holders, same issue.  Is there another way?&lt;BR /&gt;Thanks &lt;BR /&gt;-Laura</description>
      <pubDate>Fri, 08 Apr 2005 11:30:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521065#M219920</guid>
      <dc:creator>Laura Johnson_1</dc:creator>
      <dc:date>2005-04-08T11:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: if statement comparing two digit value against single digit value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521066#M219921</link>
      <description>if [[ ${TEST} -gt 5 ]]&lt;BR /&gt;&lt;BR /&gt;will fix you. You are doing a numeric comparision with -ge, -gt, -lt, -le, -eq, and '-ne' otherwise you are doing a LEXICAL comparison.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Apr 2005 11:37:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521066#M219921</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-04-08T11:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: if statement comparing two digit value against single digit value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521067#M219922</link>
      <description>putting the () around the variable returns "not found" when running set -x, unless i have missed something.&lt;BR /&gt;&lt;BR /&gt;TEST:  not found&lt;BR /&gt;+ [[  -gt 5 ]]&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Apr 2005 11:48:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521067#M219922</guid>
      <dc:creator>Laura Johnson_1</dc:creator>
      <dc:date>2005-04-08T11:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: if statement comparing two digit value against single digit value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521068#M219923</link>
      <description>never mind, those are curly brackets.  my laptop resolution is horrible.  It's an IBM, ha ha ha.</description>
      <pubDate>Fri, 08 Apr 2005 11:49:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521068#M219923</guid>
      <dc:creator>Laura Johnson_1</dc:creator>
      <dc:date>2005-04-08T11:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: if statement comparing two digit value against single digit value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521069#M219924</link>
      <description>I use this for reference:&lt;BR /&gt;&lt;BR /&gt;Testing Numeric Values&lt;BR /&gt;n1 -eq n2 --n1 equals n2&lt;BR /&gt;n1 -ge n2 --n1 is greater than or equal to n2&lt;BR /&gt;n1 -gt n2 --n1 is greater than n2&lt;BR /&gt;n1 -le n2 --n1 is less than or equal to n2&lt;BR /&gt;n1 -lt n2 --n1 is less than n2&lt;BR /&gt;n1 -ne n2 --n1 does not equal n2&lt;BR /&gt;&lt;BR /&gt;String Conditions&lt;BR /&gt;-n s1 --string s1 has non-zero length&lt;BR /&gt;-z s1 --string s1 has zero length&lt;BR /&gt;s1 = s2 --strings s1 and s2 are identical.  In Korn shell, s2 can be a regular expression.&lt;BR /&gt;s1 != s2 --strings s1 and s2 are not identical.  In Korn shell, s2 can be a regular expression&lt;BR /&gt;s1 &amp;lt; s2 --ASCII value of s1 precedes that of s2  (valid only within [[]] construct)  (K)&lt;BR /&gt;s1 &amp;gt; s2 --ASCII value of s1 follows that of s2  (valid only within [[]] construct)  (K)&lt;BR /&gt;</description>
      <pubDate>Fri, 08 Apr 2005 11:52:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521069#M219924</guid>
      <dc:creator>Robert Bennett_3</dc:creator>
      <dc:date>2005-04-08T11:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: if statement comparing two digit value against single digit value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521070#M219925</link>
      <description>Clay-&lt;BR /&gt;That was it.  Thank you.  I knew it was something so simple.  I appreciate your very prompt response on this.  &lt;BR /&gt;-Laura</description>
      <pubDate>Fri, 08 Apr 2005 11:53:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521070#M219925</guid>
      <dc:creator>Laura Johnson_1</dc:creator>
      <dc:date>2005-04-08T11:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: if statement comparing two digit value against single digit value</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521071#M219926</link>
      <description>Robert-&lt;BR /&gt;Thanks for that.  I will copy that down to my laptop and keep it for reference.&lt;BR /&gt;-Laura</description>
      <pubDate>Fri, 08 Apr 2005 11:54:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/if-statement-comparing-two-digit-value-against-single-digit/m-p/3521071#M219926</guid>
      <dc:creator>Laura Johnson_1</dc:creator>
      <dc:date>2005-04-08T11:54:25Z</dc:date>
    </item>
  </channel>
</rss>

