GNU Info

Info Node: (bashref.info)Arithmetic Expansion

(bashref.info)Arithmetic Expansion


Next: Process Substitution Prev: Command Substitution Up: Shell Expansions
Enter node , (file) or (file)node

Arithmetic Expansion
--------------------

   Arithmetic expansion allows the evaluation of an arithmetic
expression and the substitution of the result.  The format for
arithmetic expansion is:

     $(( EXPRESSION ))

   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, command
substitution, and quote removal.  Arithmetic substitutions may be
nested.

   The evaluation is performed according to the rules listed below
(Note: Shell Arithmetic).  If the expression is invalid, Bash prints
a message indicating failure to the standard error and no substitution
occurs.


automatically generated by info2www version 1.2.2.9