expr(1) - SerenityOS man pages

#Name

expr - evaluate expressions

#Synopsis

$ expr <expression>
$ expr [--help]

#Description

expr evaluates and prints the result of an expression as described below to standard output.

An expression may be any of the following:

Note that many operators will need to be escaped or quoted if used from within a shell. "falsy" means either the number 0, or the empty string.

#Options

#Examples

$ expr 1 + 2 * 3          # = 7
$ expr \( 1 + 2 \) = 3    # = 1
$ expr substr foobar 1 3  # foo

#See also