expr

Name

expr -- evaluate expressions

Description

expr is as specified in the SUS but supports extra operands as listed below.

LSB Deprecated Differences

The behaviors specified in this section are expected to disappear from a future version of the LSB; applications should only use the non-LSB-deprecated behaviors.

The following are extra operands:

match STRING REGEXP

is same as STRING : REGEXP.

substr STRING POS LENGTH

is substring of STRING, POS counted from 1.

index STRING CHARS

is index in STRING where any CHARS is found, or 0.

length STRING

is length of STRING.

quote STRING

interprets TOKEN as a string, even if it is a keyword like match or an operator like /.