[Bug 218943] /bin/sh regression? with doubly negated numbers

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Apr 28 20:44:26 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218943

            Bug ID: 218943
           Summary: /bin/sh regression? with doubly negated numbers
           Product: Base System
           Version: 11.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: z7dr6ut7gs at snkmail.com

/bin/sh has changed behavior on handling doubly (or more) negated numbers:

sh -c 'var=--123; echo $(($var))'

Under FreeBSD 9 and earlier, it "works":

123


Under 10 & 11:

sh: arithmetic expression: expecting primary: "--123"

I'm trying to find the posix stance on this.  Please add a note here if you
know where posix would weigh in on that kind of arithmetic expression.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list