On 14.6. 17:19, Jeremy Townshend wrote:
        echo $((10#-1))   # -1 as expected

Earlier discussion about the same on bug-bash:
https://lists.gnu.org/archive/html/bug-bash/2018-07/msg00015.html

Bash doesn't support the minus (or plus) sign following the 10#.
I think the expression above seems to work in this case because 10# is treated as a constant number by itself (with a value of 0), and then the 1 is subtracted.

try also e.g.:

  $ echo $((10#))
  0

        echo $((0-10#-1)) # -1 UNEXPECTED. Would expect 1.

So this is 0-0-1 = -1

--
Ilkka Virta / itvi...@iki.fi

Reply via email to