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.

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.

The caveat is, as always, that foo must be a simple hexadecimal numeric
literal, not an arbitrary expression. In particular, not a numeric literal
preceded by a unary minus.

-Martin

Reply via email to