skaembutils
Software
www.skarnet.org
The expr program
expr is a minimalistic UNIX expr program: it reads an
integer arithmetic expression on the command line, prints the result on
stdout, and exits 0 (true) if the value is non-zero and 1 (false)
otherwise. It exits 2 if it is misused.
Interface
expr [ expression ]
- Only numeric arguments are supported. String comparison functions
and pattern-matching are not implemented in that expr.
- Up to 1022 arguments are supported. You can build very long
expr expressions.
Notes
expr is very small, and it does not dynamically allocate memory.
If you need more than 1022 arguments to expr, change
the definition of TOKEN_MAX in expr.c and recompile.