Bash Bash Arithmetic

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • $(( EXPRESSION )) - Evaluates expression and returns its result.

  • expr EXPRESSION - Prints result of EXPRESSION to stdout.

Parameters

ParameterDetails
EXPRESSIONExpression to evaluate

Remarks

A space (" ") is required between each term (or sign) of the expression. "1+2" won't work, but "1 + 2" will work.



Got any Bash Question?