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 ]

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.