2023-07-05 11:43:35 +02:00
|
|
|
# Arithmetic evaluation (command)
|
|
|
|
|
|
|
|
## Synopsis
|
|
|
|
|
|
|
|
(( <EXPRESSION> ))
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
2024-01-29 02:07:56 +01:00
|
|
|
This command evaluates the [arithmetic expression](../../syntax/arith_expr.md)
|
2023-07-05 11:43:35 +02:00
|
|
|
`<EXPRESSION>`.
|
|
|
|
|
|
|
|
If the expression evaluates to 0 then the exit code of the expression is
|
|
|
|
set to 1 (`FALSE`). If the expression evaluates to something else than
|
|
|
|
0, then the exit code of the expression is set to 0 (`TRUE`). For this
|
|
|
|
return code mapping, please see [this
|
2024-01-29 02:07:56 +01:00
|
|
|
section](../../syntax/arith_expr.md#arithmetic_expressions_and_return_codes).
|
2023-07-05 11:43:35 +02:00
|
|
|
|
|
|
|
The functionality basically is equivalent to what the [`let` builtin
|
2024-01-29 02:07:56 +01:00
|
|
|
command](../../commands/builtin/let.md) does. The arithmetic evaluation compound
|
2023-07-05 11:43:35 +02:00
|
|
|
command should be preferred.
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
## Portability considerations
|
|
|
|
|
|
|
|
## See also
|
|
|
|
|
2024-01-29 02:07:56 +01:00
|
|
|
- Internal: [arithmetic expressions](../../syntax/arith_expr.md)
|
|
|
|
- Internal: [arithmetic expansion](../../syntax/expansion/arith.md)
|
|
|
|
- Internal: [The `let` builtin command](../../commands/builtin/let.md)
|