NetBSD-Bugs archive

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

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



>Number:         50827
>Category:       bin
>Synopsis:       sh -c ': "${x=$((1))}"' gives bogus syntax error
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 18 07:35:00 +0000 2016
>Originator:     Richard Hansen
>Release:        7.0
>Organization:
>Environment:
NetBSD foo.example.com 7.0 NetBSD 7.0 (GENERIC.201509250726Z) amd64

>Description:
/bin/sh incorrectly reports a syntax error ("Missing '}'") with the following line:

    : "${x=$((1))}"

The following work as expected:

    : ${x=$((1))}
    : ${x="$((1))"}
    : "${x="$((1))"}

>How-To-Repeat:
$ sh -c ': "${x=$((1))}"'
sh: Syntax error: Missing '}'

>Fix:



Home | Main Index | Thread Index | Old Index