Bash Arithmetic
suggest changeSyntax
- $(( EXPRESSION )) - Evaluates expression and returns its result.
- expr EXPRESSION - Prints result of EXPRESSION to stdout.
Parameters
Parameter | Details |
—— | —— |
EXPRESSION | Expression to evaluate |
Remarks
With expr, a space is required between each term (or sign) of the expression. 1+2 will not work, but 1 + 2 will. $((1+2)) does not need those spaces.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents