Search notes:

Shell command: expr

$ expr 4 + 3
7

$ expr 4.1 + 3.2
expr: non-integer argument
Beware of the expansion of the *:
$ expr 3 * 8
expr: syntax error: unexpected argument FILENAME

$ expr '3 * 8'
3 * 8

$ expr 3 '*' 8
24
$ expr 12 / 3
4

$ expr 13 / 3
4

$ expr 12/3
12/3

See also

Using expr and date to calculate elapsed time.
test
Shell commands (such as bc) and the bash built-in let.

Links

expr on github

Index