Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2012 22:26:37 +0000
From:      David O'Brien <obrien@FreeBSD.ORG>
To:        Jilles Tjoelker <jilles@stack.nl>
Cc:        stable@freebsd.org
Subject:   Re: /bin/sh arithmetic doesn't seem to like leading 0 now
Message-ID:  <20120921222637.GA58984@hub.freebsd.org>
In-Reply-To: <20120921173406.GC9070@stack.nl>
References:  <20120921170902.GC28959@albert.catwhisker.org> <20120921173406.GC9070@stack.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 21, 2012 at 07:34:06PM +0200, Jilles Tjoelker wrote:
> On Fri, Sep 21, 2012 at 10:09:02AM -0700, David Wolfskill wrote:
> > $ echo $(( ( $( date +%m ) - 1 ) / 3 + 1 ))
> > arithmetic expression: expecting ')': " ( 09 - 1 ) / 3 + 1 "
...
> This was done to avoid an inconsistency where constants starting with
> "0" and containing "8" or "9" were decimal, so something like
> $((018-017)) expanded to 3.

Jilles,
Would it be possible to improve on the error message?
If David had been given the Bash error message, I suspect he would have
figured out the issue right away.

-- 
-- David    (obrien@FreeBSD.org)



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