expr
Evaluates an expression
expr expression
The expr utility evaluates an expression and displays the result. The utility evaluates character strings that represent either numeric or nonnumeric values. Operators are used with the strings to form expressions.
Arguments
The expression is composed of strings with operators in between. Each string and operator constitute a distinct argument that you must separate from other arguments with a SPACE. You must quote operators that have special meanings to the shell (for example, the multiplication operator, *).
The following list of expr operators is in order of decreasing precedence. Each group of operators has the same precedence. You can change the order of evaluation with parentheses.
:
comparison ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access