Meaning of `10#N`
10#N
or a general form [base#]n
where 2 <= base <= 64
will interpret n
as the number in that base.
The bash
manual, section Shell Arithmetic mentioned this.
Note that this feature is not specified by POSIX, only available in bash
, ksh
and its derivatives, zsh
with base between 2 and 36.
From the Arithmetic Evaluation section of the bash manual,
Constants with a leading 0 are interpreted as octal numbers. A leading 0x or 0X denotes hexadecimal. Otherwise, numbers take the form [base#]n, where base is a decimal number between 2 and 64 representing the arithmetic base, and n is a number in that base. If base# is omitted, then base 10 is used. The digits greater than 9 are represented by the lowercase letters, the uppercase letters, @, and _, in that order. If base is less than or equal to 36, lowercase and uppercase letters may be used interchangeably to represent numbers between 10 and 35.
Of course it is in the man bash
Inside ARITHMETIC EVALUATION
:
LESS=+/'\[base#\]n,' man bash
Otherwise, numbers take the form [base#]n, where the optional base is a decimal number between 2 and 64 representing the arithmetic base, and n is a number in that base.