On Wed, Jul 23, 2014 at 1:29 PM, Chet Ramey <chet.ra...@case.edu> wrote:
> On 7/23/14, 3:20 AM, maik.lied...@sungard.com wrote:
>> hello,
>>
>> to change our scripts from ksh to bash we have problems with vars and 
>> leading zeros.
>> how we can declare hrs and min?
>
> Greg offered several good suggestions to force base 10 in certain
> situations.
>
>> or can we disable the automatic change from decimal to octal?
>
> No.  Bash treats integer constants identically regardless of the context: a
> leading 0 denotes octal.  ksh93 treats constants with leading zeros
> differently in different contexts (assigning to a variable with the integer
> attribute set happens to be one of the cases where ksh93 treats a constant
> as strictly decimal).

I don't believe there are any cases in which ksh interprets a leading
zero, at least not current versions. If you want octal you must use
either 8#num or typeset -ibase. Same applies to both zsh and mksh
AFAICT.

Reply via email to