string1 != string2
True if the strings are not equal. string1 < string2
True if string1 sorts before string2 lexicographically. string1 > string2
True if string1 sorts after string2 lexicographically. arg1 OP arg2
OP is one of ‘-eq’, ‘-ne’, ‘-lt’, ‘-le’, ‘-gt’, or ‘-ge’. These arithmetic binary operators return true if arg1 is equal to, not equal to, less than, less than or equal to, greater than, or greater than or equal to arg2, respectively. Arg1 and arg2 may be positive or negative integers.
6.5 Shell Arithmetic
The shell allows arithmetic expressions to be evaluated, as one of the shell expansions or by the let and the -i option to the declare builtins.
Evaluation is done in fixed-width integers with no check for overflow, though division by
0 is trapped and flagged as an error. The operators and their precedence, associativity, and values are the same as in the C language. The following list of operators is grouped into levels of equal-precedence operators. The levels are listed in order of decreasing precedence. id++ id-- variable post-increment and post-decrement
++id --id variable pre-increment and pre-decrement
- + unary minus and plus
! ~ logical and bitwise negation
** exponentiation
* / % multiplication, division, remainder
+ - addition, subtraction
<< >> left and right bitwise shifts
<= >= < > comparison
== != equality and inequality
& bitwise AND
^ bitwise exclusive OR
| bitwise OR
&& logical AND
|| logical OR expr ? expr : expr conditional operator
= *= /= %= += -= <<= >>= &= ^= |= assignment