You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZSH rewrites hexadecimal to base#literal which then breaks the [ command because it expects the operands to in base 10 (without the 10x prefix). This can be fixed by wrapping the hexadecimal literal in an arithmetic expansion to force the conversion to base 10.
The text was updated successfully, but these errors were encountered:
laurenthuberdeau
changed the title
ZSH doesn't work well with hexadecimal and octal literals
ZSH support for hexadecimal and octal literals isn't POSIX compliant
Feb 20, 2025
Hexadecimal
ZSH rewrites hexadecimal to
base#literal
which then breaks the[
command because it expects the operands to in base 10 (without the10x
prefix). This can be fixed by wrapping the hexadecimal literal in an arithmetic expansion to force the conversion to base 10.Small example showing the issue:
Octal
ZSH doesn't parse octal literals (with a leading 0) unless the
OCTAL_ZEROES
option is enabled.The text was updated successfully, but these errors were encountered: