[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/50958: /bin/sh $(( )) does not support ?: or assignment operators
>Synopsis: /bin/sh $(( )) does not support ?: or assignment operators
>Arrival-Date: Sat Mar 12 18:05:00 +0000 2016
>Originator: Robert Elz
>Release: NetBSD 7.99.26 (any version up to date of PR).
System: NetBSD andromeda.noi.kre.to 7.99.26 NetBSD 7.99.26 (VBOX64-1.1-20160128) #43: Thu Jan 28 16:09:08 ICT 2016 kre%onyx.coe.psu.ac.th@localhost:/usr/obj/current/kernels/amd64/VBOX64 amd64
According to POSIX, the expressions in $(( )) evaluation should
allow anything permitted in C expressions, except that ++ and --
(prefix or postfix) are not required (and not implemented, though
they would be useful) and sizeof (which wouldn't be rational.)
(Support is only required for signed integers, which is fine.)
NetBSD's /bin/sh does not support ?: or any of the assignment
/bin/sh -c 'echo $(( 1 ? 2 : 3 ))'
sh: arith: syntax error: " 1 ? 2 : 3 "
/bin/sh -c 'echo $(( x=3 ))'
sh: arith: syntax error: " x=3 "
This is another "placeholder" PR... I have a fix for ?:
(actually wanted to use it in a script, only to discover it
The assignment ops will get worked on in time...
May even include ++ and -- support at the same time, if it
looks reasonable (they're not prohibited, just not required.)
Main Index |
Thread Index |