Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2012 13:26:08 -0400
From:      Daryl Richards <daryl@isletech.net>
To:        freebsd-stable@freebsd.org
Subject:   Re: /bin/sh arithmetic doesn't seem to like leading 0 now
Message-ID:  <505CA330.3050206@isletech.net>
In-Reply-To: <CAKFCL4Wub=k1RA_yYm2xFaoQUBt8Yfj1OONG33z2YFJJwSx_DA@mail.gmail.com>
References:  <20120921170902.GC28959@albert.catwhisker.org> <CAKFCL4Wub=k1RA_yYm2xFaoQUBt8Yfj1OONG33z2YFJJwSx_DA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 21/09/2012 1:20 PM, Brandon Allbery wrote:
> On Fri, Sep 21, 2012 at 1:09 PM, David Wolfskill <david@catwhisker.org>wrote:
>
>> $ echo $(( 09 + 0 ))
>>
> Unable to get to fbsd box now but suspicious mind wants to know what
> happens with 07 in place of 09.
>

Interestingly enough, bash gives a proper explanation:

bash$ echo $(( 09 + 0 ))
-bash: 09: value too great for base (error token is "09")
bash$ echo $(( 07 + 0 ))
7

-- 
Daryl Richards
Isle Technical Services Inc
(519) 573-3399




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?505CA330.3050206>