expr Command Examples

Evaluate expressions and manipulate strings. More information: https://www.gnu.org/software/coreutils/expr.

expr length "{{string}}"

expr substr "{{string}}" {{from}} {{length}}

expr match "{{string}}" '{{pattern}}'

expr index "{{string}}" "{{chars}}"

expr {{expression1}} {{+|-|*|/|%}} {{expression2}}

expr {{expression1}} \| {{expression2}}

expr {{expression1}} \& {{expression2}}