Use to perform arithmetic operations. Syntax:
expr op1 math-operator op2
Examples:
$ expr 1 + 3
$ expr 2 - 1
$ expr 10 / 2
$ expr 20 % 3
$ expr 10 \* 3
$ echo `expr 6 + 3`
- Multiplication use
and not since its wild card.
- Before expr keyword we used ` (back quote) sign not the (single quote i.e. ') sign. expr is also end with ` i.e. back quote.
- If you use double quote or single quote, it will NOT work.