Documentation
¶
Overview ¶
Package expr implements the POSIX expr utility, with the string keywords and the + quoting token of the GNU one.
The whole command line is parsed as a single expression, in which each token is a separate argument. Evaluation follows the precedence of the operators, all of which are left-associative, evaluating immediately and short-circuiting the | and & connectives as GNU expr does.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Prog ¶
Prog is the expr core utility.
func (*Prog) Run ¶
Run evaluates the expression given as arguments and writes the result to the standard output, even when it is null or zero. It exits with status 1 when the result is null or zero, 2 when the expression is invalid, and 3 when the evaluation fails, like on an out of range numeric result or a failed write.