Arithmetic Expressions

The let built-in command performs integer arithmetic. You can substitute arithmetic values (for use as command arguments or in variables); base conversion is also possible.

Expression

Meaning

$(( expr ))

Use the value of the enclosed arithmetic expression.

B# n

Interpret integer n in numeric base B. For example, 8#100 specifies the octal equivalent of decimal 64.

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.