MPE/iX Shell and Utilities Reference Manual, Vol 2

sh(1) MPE/iX Shell and Utilities sh(1)
${parameter%%pattern}
is similar to the preceding construct, except that sh deletes the longest part that
matches pattern if it finds such a match.
Arithmetic Substitution
Arithmetic substitution is available with the syntax:
$((arithmetic expression))
or
$[arithmetic expression]
sh replaces this sequence with the value of arithmetic expression. Arithmetic expressions
consist of expanded variables, numeric constants, and operators.
Numeric constants have the form
[base#]number
where the optional base is a decimal integer between 2 and 36 inclusive, and number is a non-
negative number in the given base. The default base is 10. Undefined variables evaluate to
zero.
Table 1-10, Shell Operators, lists the operators in decreasing order of precedence. Operators
sharing a heading have the same precedence. Evaluation within a precedence group is from
left to right, except for the assignment operator which evaluates from right to left.
Arithmetic expressions may be used without the enclosing $(( and )) in assignment to an
integer variable (see typeset(1)); as an argument to the following built-in commands:
break continue exit let return shift
Commands and Utilities 1-533