<?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 bug? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884824#M935355</link>
    <description>HP helped me find the culprit:&lt;BR /&gt;PHCO_26789&lt;BR /&gt;You were correct though.  From the script text:  &lt;BR /&gt;The shell now recognizes octal and hexadecimal numbers inside arithmetic expressions.  This may impact the behavior of certain scripts.</description>
    <pubDate>Fri, 17 Jan 2003 21:40:04 GMT</pubDate>
    <dc:creator>Robert Grabowy</dc:creator>
    <dc:date>2003-01-17T21:40:04Z</dc:date>
    <item>
      <title>script bug?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884820#M935351</link>
      <description>we have two identical servers running same os and patch level.  On wednesday evening we installed qpk and hwe 9/02 bundles.  The next day several scripts were failing that contained the following while statement:&lt;BR /&gt;&lt;BR /&gt;STARTHOUR=6&lt;BR /&gt;ENDHOUR=15&lt;BR /&gt;hour=08&lt;BR /&gt;while (( $hour &amp;gt;= $STARTHOUR  &amp;amp;&amp;amp;  $hour &amp;lt; $ENDHOUR ))&lt;BR /&gt;do&lt;BR /&gt;   echo "running while number 1" &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The weird part is that it fails when hour = 08 or 09. 01-07 or 10+ works fine.  I don't like blaming patches for script errors but it's an awful coincidence.</description>
      <pubDate>Fri, 17 Jan 2003 21:02:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884820#M935351</guid>
      <dc:creator>Robert Grabowy</dc:creator>
      <dc:date>2003-01-17T21:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: script bug?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884821#M935352</link>
      <description>Make this change and all will be well,&lt;BR /&gt;&lt;BR /&gt;hour=08&lt;BR /&gt;to&lt;BR /&gt;typeset -i hour=08&lt;BR /&gt;&lt;BR /&gt;The shell is trying to intepret 08 as octal and ,of course, 08 &amp;amp; 09 are invalid octal values.&lt;BR /&gt;&lt;BR /&gt;The typeset coerces the intepretation as decimal integers.&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Jan 2003 21:10:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884821#M935352</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-01-17T21:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: script bug?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884822#M935353</link>
      <description>Thank you very much.  That worked.  Won't I don't understand is why it worked prior to the upgrade.  The other server in the pair has not completed the upgrade yet and the script works fine.  Thanks again.</description>
      <pubDate>Fri, 17 Jan 2003 21:15:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884822#M935353</guid>
      <dc:creator>Robert Grabowy</dc:creator>
      <dc:date>2003-01-17T21:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: script bug?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884823#M935354</link>
      <description>While I don't specifically know  caused your problem, I'm betting that it's related to shared library routines.&lt;BR /&gt;&lt;BR /&gt;The strtol (string to long) function, if given a zero base argument, works like this:&lt;BR /&gt;If it sees a leading '0' then the value is interpreted as octal, if it sees a leading 0x or 0X, the value is intepreted as hexadecimal. Otherwise the value is decimal.&lt;BR /&gt;&lt;BR /&gt;Man strtol for details.&lt;BR /&gt;&lt;BR /&gt;I've seen this 'problem' occur between diffrent platforms and flavors of UNIX and when patches are appiled. The disciplined shell programmer will assume this behavior if any variables might have leading zeroes and typeset the variables to avoid this. This is one of those cases when you understand the underlying C, it's easier to understand what's going on.&lt;BR /&gt;&lt;BR /&gt;Regards, Clay&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Jan 2003 21:28:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884823#M935354</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2003-01-17T21:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: script bug?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884824#M935355</link>
      <description>HP helped me find the culprit:&lt;BR /&gt;PHCO_26789&lt;BR /&gt;You were correct though.  From the script text:  &lt;BR /&gt;The shell now recognizes octal and hexadecimal numbers inside arithmetic expressions.  This may impact the behavior of certain scripts.</description>
      <pubDate>Fri, 17 Jan 2003 21:40:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-bug/m-p/2884824#M935355</guid>
      <dc:creator>Robert Grabowy</dc:creator>
      <dc:date>2003-01-17T21:40:04Z</dc:date>
    </item>
  </channel>
</rss>

