NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/50827: sh -c ': "${x=$((1))}"' gives bogus syntax error



The following reply was made to PR bin/50827; it has been noted by GNATS.

From: Richard Hansen <rhansen%rhansen.org@localhost>
To: gnats-bugs%NetBSD.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/50827: sh -c ': "${x=$((1))}"' gives bogus syntax error
Date: Fri, 19 Feb 2016 22:45:04 -0500

 On 2016-02-19 04:35, Robert Elz wrote:
 > It also mishandles ...
 > 
 > sh -c ': ${x="$(("1"))"}'
 > sh: Syntax error: Missing '))'
 
 From http://austingroupbugs.net/view.php?id=985#c2885 (which will become
 POSIX standard once approved):
 
     The expression shall be expanded as if it were a word in
     double-quotes, except that the treatment of a double-quote inside
     the expression is unspecified and the result of parameter expansion
     of the '@' special parameter is unspecified.
 
 So the NetBSD shell is OK as-is in this regard, though it doesn't hurt
 to change the shell to treat "$(("1"))" like "$((1))" because POSIX says
 (will say) "unspecified".
 



Home | Main Index | Thread Index | Old Index