/
EXPR
EXPR
Command-line utility to evaluate regular expressions. EXPR can be used in Action-Command attributes and Trigger-Command attributes. EXPR uses a set of arithmetical and Boolean operators to perform simple evaluations between two arguments. EXPR is also used to set the integer value.
ARG1 | ARG2 | ARG1 if it is neither null nor 0, otherwise ARG2 ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0 ARG1 < ARG2 ARG1 is less than ARG2 |
ARG1 <= ARG2 | ARG1 is less than or equal to ARG2 |
ARG1 = ARG2 | ARG1 is equal to ARG2 |
ARG1 != ARG2 | ARG1 is unequal to ARG2 |
ARG1 >= ARG2 | ARG1 is greater than or equal to ARG2 |
ARG1 > ARG2 | ARG1 is greater than ARG2 |
ARG1 + ARG2 | Arithmetic sum of ARG1 and ARG2 ARG1 - ARG2 arithmetic difference of ARG1 and ARG2 ARG1 * ARG2 arithmetic product of ARG1 and ARG2 |
ARG1 / ARG2 | Arithmetic quotient of ARG1 divided by ARG2 |
ARG1 % ARG2 | Arithmetic remainder of ARG1 divided by ARG2 |
Example
# Add 1 to the variable $counter
expr: $counter = $counter + 1
# Compute the remainder of the variable $counter divided by 2
expr: $remainder = $counter % 2
# Assign the integer value to the variable $name
expr: $name = 6
Related content
Logical Expressions and Regular Expressions
Logical Expressions and Regular Expressions
More like this
Using the Expression <Expr> Element
Using the Expression <Expr> Element
More like this
PCRE - Perl Compatible Regular Expressions
PCRE - Perl Compatible Regular Expressions
More like this
Using Expression Modifiers
Using Expression Modifiers
More like this
Expression Attributes and Matching
Expression Attributes and Matching
More like this