From owner-freebsd-stable@FreeBSD.ORG Fri Sep 21 17:09:03 2012 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A16F7106564A for ; Fri, 21 Sep 2012 17:09:03 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (m209-73.dsl.rawbw.com [198.144.209.73]) by mx1.freebsd.org (Postfix) with ESMTP id 79DD38FC08 for ; Fri, 21 Sep 2012 17:09:03 +0000 (UTC) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.14.5/8.14.5) with ESMTP id q8LH92Pi029390 for ; Fri, 21 Sep 2012 10:09:02 -0700 (PDT) (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.14.5/8.14.5/Submit) id q8LH92R3029389 for stable@freebsd.org; Fri, 21 Sep 2012 10:09:02 -0700 (PDT) (envelope-from david) Date: Fri, 21 Sep 2012 10:09:02 -0700 From: David Wolfskill To: stable@freebsd.org Message-ID: <20120921170902.GC28959@albert.catwhisker.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HG+GLK89HZ1zG0kk" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: /bin/sh arithmetic doesn't seem to like leading 0 now X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2012 17:09:03 -0000 --HG+GLK89HZ1zG0kk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I have a construct in a shell script that I had been using under stable/8 (most recently, @r240259), but which throws an error under stable/9 (at least as early as @r238602): $ echo $(( ( $( date +%m ) - 1 ) / 3 + 1 )) 3 $ uname -r 8.3-PRERELEASE $ echo $(( ( $( date +%m ) - 1 ) / 3 + 1 )) arithmetic expression: expecting ')': " ( 09 - 1 ) / 3 + 1 " $ uname -r 9.1-PRERELEASE Trying bits & pieces of the above, I narrowed the issue down to: $ echo $(( 09 + 0 )) arithmetic expression: expecting EOF: " 09 + 0 " while $ echo $(( 9 + 0 )) 9 $=20 is not a problem. Is this intentional? (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.) Thanks! Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --HG+GLK89HZ1zG0kk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlBcny4ACgkQmprOCmdXAD0Y5QCghiCMxA8YqssEHo0tNQs9AUwq RIEAnixWPy52qwvII/RJokyOexuNH7IG =hjRg -----END PGP SIGNATURE----- --HG+GLK89HZ1zG0kk--