On Fri, Sep 21, 2012 at 07:34:06PM +0200, Jilles Tjoelker wrote: > ... > > Is this intentional? > > Yes, it was changed with r216547, December 2010. > > 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.
Ah; OK.
> There are indeed various cases where this inconsistency does not matter
> (because the numbers with leading zeroes do not exceed 10).
Sure. Especially when working with "month numbers". :-}
> > (I can work around it -- e.g., by using sed to strip leading 0 from the
> > month number (since strftime() doesn't appear to have a format that
> > provides the value in a form that lacks the leading zero for values <
> > 10). But I'd rather not do that if I don't need to.)
>
> You can use date +%-m although it is not in POSIX.
Ah -- I see that now ("%-* GNU libc extension....")
> With POSIX only, it is still possible to do it reasonably efficiently,
> for example $(( 1$(date +%m) - 100 )) or v=$(date +%m); v=${v#0}.
> ...
Thanks.
Peace,
david
--
David H. Wolfskill [email protected]
Depriving a girl or boy of an opportunity for education is evil.
See http://www.catwhisker.org/~david/publickey.gpg for my public key.
pgpASE76ajrnq.pgp
Description: PGP signature
