bug-bash
[Top][All Lists]
Advanced

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

Re: "echo $((0x))" is accepted, treated as 0x0


From: Chet Ramey
Subject: Re: "echo $((0x))" is accepted, treated as 0x0
Date: Mon, 26 Jan 2026 13:16:24 -0500
User-agent: Mozilla Thunderbird

On 1/24/26 8:23 AM, Denys Vlasenko wrote:

But why it's different for

$ digits=''; echo $((16#$digits))
bash: 16#: invalid integer constant (error token is "16#")

I changed it back in 2020. Here's the original report.

https://lists.gnu.org/archive/html/bug-bash/2019-06/msg00039.html

There were some notable objections:

https://lists.gnu.org/archive/html/bug-bash/2022-07/msg00072.html

and the expected rebuttals:

https://lists.gnu.org/archive/html/bug-bash/2022-07/msg00073.html

I was convinced to keep the 0x extension for backwards compatibility.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]