[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/
OpenPGP_signature.asc
Description: OpenPGP digital signature
- "echo $((0x))" is accepted, treated as 0x0, Denys Vlasenko, 2026/01/23
- Re: "echo $((0x))" is accepted, treated as 0x0, Andreas Kähäri, 2026/01/24
- Re: "echo $((0x))" is accepted, treated as 0x0, Martin D Kealey, 2026/01/24
- Re: "echo $((0x))" is accepted, treated as 0x0, Denys Vlasenko, 2026/01/24
- Re: "echo $((0x))" is accepted, treated as 0x0,
Chet Ramey <=
- Re: "echo $((0x))" is accepted, treated as 0x0, Andreas Schwab, 2026/01/24
- Re: "echo $((0x))" is accepted, treated as 0x0, Chet Ramey, 2026/01/26
- Re: "echo $((0x))" is accepted, treated as 0x0, Robert Elz, 2026/01/24
- Re: "echo $((0x))" is accepted, treated as 0x0, Chet Ramey, 2026/01/26