Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jun 2003 14:50:16 -0700 (PDT)
From:      Wartan Hachaturow <wart@tepkom.ru>
To:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/52972: /bin/sh arithmetic not POSIX compliant
Message-ID:  <200306222150.h5MLoGpX061341@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR standards/52972; it has been noted by GNATS.

From: Wartan Hachaturow <wart@tepkom.ru>
To: Jens Schweikhardt <schweikh@schweikhardt.net>
Cc: GNATS Bug Followup <bug-followup@FreeBSD.org>
Subject: Re: standards/52972: /bin/sh arithmetic not POSIX compliant
Date: Mon, 23 Jun 2003 01:41:42 +0400

 On Sun, Jun 22, 2003 at 10:43:27PM +0200, Jens Schweikhardt wrote:
 > [please always cc to <bug-followup@FreeBSD.org> with the subject left as
 > is (like in this mail), so GNATS can add your comments to the audit
 > trail. Thanks!]
 
 Sure, I just thought my initial letter wasn't valuable enough to
 be included in the trail :)
 
 > The recursive processing requires that $(($a+1)) needs to undergo
 > parameter expansion within $(()).
 
 Right, but this construction works in /bin/sh:
 
 wart@mojo:~$ /bin/sh
 $ a=1
 $ echo $(($a+1))
 2
 
 You've said the problem was with the variable without leading $, like
 this:
 $ a=1
 $ echo $((a+1)) 
 arith: syntax error: "a+1"
 
 And, as far as my English allows me to judge, the quoted part of SUS
 says that "a" in this construct should be left in output as is (since it
 doesn't have leading $, ${, $(, etc.), shouldn't it?
 
 -- 
 Regards, Wartan.
 "Computers are not intelligent. They only think they are."



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