Version 0.2.0 behavior is documented here. Thesupport record separates local verification frompublished MoonX behavior; moonx examples use registry releases.
Evaluate integer and string expressions. Pass each operator and operand as aseparate argument; quote operators that the calling shell would interpret.
Supports |, &, comparisons (=, ==, !=, <, <=, >, >=),integer +, -, *, /, %, anchored BRE matching with :, and parentheses.Integer arithmetic is not limited to machine-word size. Logical operatorsshort-circuit evaluation; skipped expressions still require valid syntax.
length, index, substr, and match provide string operations. Prefix +quotes the next argument as a string, including keywords and operators.Matching returns the first captured group when present, otherwise the matchedbyte count. Strings use byte offsets and C-locale ordering. The shared BREmatcher supports pattern backreferences, byte classes and word assertions.Repeated nullable captures follow the tested GNU candidate and capture-registerselection, including counted repeats and references. See theworkspace support record.Locale-aware character operations are not included. --help, --version, andthe leading -- separator are available.
Exit status is 0 for a nonempty, nonzero result, 1 for an empty or zero result,and 2 for invalid expressions or evaluation errors.
Standalone --version prints exactly expr 0.2.0 followed by onenewline. Standalone --help starts with Usage: expr, lists bothmetadata options, and ends with a newline. Both write to stdout, leave stdinunread, and exit with status 0. Exact-version publication and verificationremain recorded separately in the support record.