expr — Evaluate Arguments as an Expression

Synopsis

/usr/bin/expr argument... 
/usr/xpg4/bin/expr argument... 
/usr/ucb/expr argument... 

Description

The expr command evaluates the expression and writes the result to standard output. Each token of the expression is a separate argument, so you must separate terms of the expression by blanks. Quote strings containing blanks or other special characters. You can precede integer-valued arguments by a unary minus sign. Escape characters special to the shell. The length of the expression is limited to LINE_MAX (2048 characters).

Note

The character 0 is written to indicate a zero value and nothing is written to indicate a null string.

Operands

The operators and keywords are listed below. The list ...

Get Solaris™ 7 Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.