Arithmetic Expansion
Up
Next
Previous
Arithmetic Expansion
Arithmetic expansion allows the evaluation of an arithmetic expression
and the substitution of the result. The format for arithmetic expansion is:
The
expression
is treated as if it were within double quotes, but a double quote
inside the parentheses is not treated specially.
All tokens in the expression undergo parameter expansion, string
expansion, command substitution, and quote removal.
Arithmetic substitutions may be nested.
The evaluation is performed according to the rules listed below under
.SM
.BR "ARITHMETIC EVALUATION" .
If
expression
is invalid,
bash
prints a message indicating failure and no substitution occurs.
Up
Next
Previous