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



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