/bin/sh arithmetic doesn't seem to like leading 0 now
Daryl Richards
daryl at isletech.net
Fri Sep 21 17:58:02 UTC 2012
On 21/09/2012 1:20 PM, Brandon Allbery wrote:
> On Fri, Sep 21, 2012 at 1:09 PM, David Wolfskill <david at 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
More information about the freebsd-stable
mailing list