bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: integer addition crash


From: Jonathan Nieder
Subject: Re: integer addition crash
Date: Wed, 20 Jul 2011 13:46:56 -0500
User-agent: Mutt/1.5.21+46 (b01d63af6fea) (2011-07-01)

Hi Cédric,

Cédric Martínez Campos wrote:

>       $ echo $((08+1))
>       bash: 08: too big element for the base (the error element is "08")
> [translated from spanish]

Strings of digits starting with a '0' in an arithmetic expansion are
octal numbers.  The bash FAQ[*] has some details.

Hope that helps,
Jonathan

[*] http://tiswww.case.edu/php/chet/bash/FAQ
question E8 ("Why does the arithmetic evaluation code complain about
`08'?")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]