<?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: Shell error with addition in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088310#M806322</link>
    <description>Steve,&lt;BR /&gt;&lt;BR /&gt;if you read the description of the patch, it says that a parameter with a leading 0 is interpreted as an octal number IF you INSTALL this patch.&lt;BR /&gt;And i don't need the 'sed' tool for a workaround :&lt;BR /&gt;numero=${numero##*0}</description>
    <pubDate>Thu, 09 Oct 2003 03:59:26 GMT</pubDate>
    <dc:creator>marc seguin</dc:creator>
    <dc:date>2003-10-09T03:59:26Z</dc:date>
    <item>
      <title>Shell error with addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088301#M806313</link>
      <description>With /usr/bin/sh on HP-UX 11.11, i get this strange error :&lt;BR /&gt;&lt;BR /&gt;# typeset -Z2 numero=7                           &lt;BR /&gt;# echo $numero&lt;BR /&gt;07&lt;BR /&gt;# (( numero = $numero + 1 ))&lt;BR /&gt;# echo $numero&lt;BR /&gt;08&lt;BR /&gt;# (( numero = $numero + 1 ))&lt;BR /&gt;sh: 08 + 1 : The specified number is not valid for this command.&lt;BR /&gt;&lt;BR /&gt;Is there a patch for this bug ?</description>
      <pubDate>Wed, 08 Oct 2003 10:45:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088301#M806313</guid>
      <dc:creator>marc seguin</dc:creator>
      <dc:date>2003-10-08T10:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Shell error with addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088302#M806314</link>
      <description>Hi Marc,&lt;BR /&gt; &lt;BR /&gt;This has to be due to the -Z.&lt;BR /&gt;Try it with -i2 - that defines it as an integer &amp;amp; speeds the math to boot.&lt;BR /&gt; &lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Wed, 08 Oct 2003 11:03:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088302#M806314</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2003-10-08T11:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Shell error with addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088303#M806315</link>
      <description>Hi,&lt;BR /&gt;I don't that it is even oficailly recognized as a bug: a numeric string preceded with 0 is interpreted as octal notation. You probaly have to change your variable definition to something like&lt;BR /&gt; typeset -i numero=7&lt;BR /&gt; and then perform other operations in order to write it with a zero in front.&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Wed, 08 Oct 2003 11:10:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088303#M806315</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-10-08T11:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Shell error with addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088304#M806316</link>
      <description>Hi John,&lt;BR /&gt; &lt;BR /&gt;The -Z right justifies &amp;amp; pads the value with leading zeros if the first nonblank char is a digit. The pad depends on the n value - in this case 2.&lt;BR /&gt;So the 7 is padded to 07.&lt;BR /&gt;&lt;BR /&gt;BUT - I don't *think* it's stored as an integer &amp;amp; I think that's what is causing the "message".&lt;BR /&gt; &lt;BR /&gt;Rgds,&lt;BR /&gt;Jeff</description>
      <pubDate>Wed, 08 Oct 2003 11:16:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088304#M806316</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2003-10-08T11:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Shell error with addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088305#M806317</link>
      <description>Hi Jeff,&lt;BR /&gt;you are probably right. I just thought that the system was protesting against doing an addition to what it considered being the highest octal number.&lt;BR /&gt;  &lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Wed, 08 Oct 2003 11:23:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088305#M806317</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-10-08T11:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Shell error with addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088306#M806318</link>
      <description>I don't agree with your explanations.&lt;BR /&gt;If my parameter is to be considered as an octal value, it can't be 8 (or 08). And "07 + 1" would give 10.&lt;BR /&gt;&lt;BR /&gt;With HP-UX 10.20, i don't have this result.&lt;BR /&gt;I get :&lt;BR /&gt;# typeset -Z2 string=7&lt;BR /&gt;# (( string = $string + 1 ))&lt;BR /&gt;# echo $string&lt;BR /&gt;08&lt;BR /&gt;# (( string = $string + 1 ))&lt;BR /&gt;# echo $string&lt;BR /&gt;09&lt;BR /&gt;&lt;BR /&gt;Which is OK !!&lt;BR /&gt;&lt;BR /&gt;With HP-UX 11.11, i can solve my problem in using two parameters ,one as a string[Z2] and one as an integer. But i don't think it is a normal behaviour.</description>
      <pubDate>Thu, 09 Oct 2003 02:02:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088306#M806318</guid>
      <dc:creator>marc seguin</dc:creator>
      <dc:date>2003-10-09T02:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: Shell error with addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088307#M806319</link>
      <description>Hi again Marc,&lt;BR /&gt;I still think the problem is related to the system perceiving "08" as an octal value.&lt;BR /&gt;And although I do not like to disagree  with Pharaohs I think the problem fits the description for patch PHCO_29699, which holds a reference to patch PHCO_26789:&lt;BR /&gt; &lt;A href="http://www4.itrc.hp.com/service/cki/patchDocDisplay.do?patchId=PHCO_29699" target="_blank"&gt;http://www4.itrc.hp.com/service/cki/patchDocDisplay.do?patchId=PHCO_29699&lt;/A&gt;&lt;BR /&gt; &lt;BR /&gt; Please see the "Defect description" and the error message.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Oct 2003 02:11:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088307#M806319</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-10-09T02:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Shell error with addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088308#M806320</link>
      <description>Hi John,&lt;BR /&gt;YES ! I understand now. So i was wrong, and it is a normal behaviour. And the Pharoahs are still the Pharoahs !&lt;BR /&gt;Since HP-UX 11 accepts ISOC standards... and not HP-UX 10.20.&lt;BR /&gt;(( 07 + 1 )) is calculated as an octal value, but the result is put in a string parameter as a decimal value, so i get 08. And (( 08 + 1 )) is impossible as an octal operation.&lt;BR /&gt;CQFD</description>
      <pubDate>Thu, 09 Oct 2003 02:36:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088308#M806320</guid>
      <dc:creator>marc seguin</dc:creator>
      <dc:date>2003-10-09T02:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Shell error with addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088309#M806321</link>
      <description>Hi,&lt;BR /&gt; &lt;BR /&gt;If for whatever reasons you do not install the patch, one workaround is to strip the 0 prefix e.g.:&lt;BR /&gt; &lt;BR /&gt;numero=`echo $numero | sed 's/^0//'`&lt;BR /&gt; &lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt; &lt;BR /&gt;Steven Sim Kok Leong</description>
      <pubDate>Thu, 09 Oct 2003 03:33:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088309#M806321</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2003-10-09T03:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Shell error with addition</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088310#M806322</link>
      <description>Steve,&lt;BR /&gt;&lt;BR /&gt;if you read the description of the patch, it says that a parameter with a leading 0 is interpreted as an octal number IF you INSTALL this patch.&lt;BR /&gt;And i don't need the 'sed' tool for a workaround :&lt;BR /&gt;numero=${numero##*0}</description>
      <pubDate>Thu, 09 Oct 2003 03:59:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/shell-error-with-addition/m-p/3088310#M806322</guid>
      <dc:creator>marc seguin</dc:creator>
      <dc:date>2003-10-09T03:59:26Z</dc:date>
    </item>
  </channel>
</rss>

