On Mon, Feb 10, 2025, at 1:05 PM, Andreas Schwab wrote:
> On Feb 10 2025, Greg Wooledge wrote:
>
>> No, I've shown that it *is* working in older versions of bash, and I'm
>> asking *why*.
>
> Does it?  If it did, it should have printed -23, not -19.

Yeah, it doesn't work.  The pattern ?([-+]) matches any character
followed by either a - or + in parentheses, so the substitution
doesn't actually replace anything, and -023 is treated as octal.

        bash-3.2$ echo "$(( -023 ))"
        -19

-- 
vq

Reply via email to