On 1/24/26 4:23 AM, Martin D Kealey wrote:
On Sat, 24 Jan 2026 at 12:10, Denys Vlasenko <[email protected]> wrote:

Subject: "echo $((0x))" is accepted, treated as 0x0
The subject says it all.


Working as intended and as documented.

Intended, yes, as a longtime extension. Documented as such, not so much.

This is so that "echo $((0x$foo))" works as intended when foo contains only
hexadecimal digits. Note that the empty string complies with that
requirement.

This is not a particularly strong argument. If there's a concern that $foo
might be empty, there are easy workarounds.

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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to