[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Comparison expressions compare operands for relationships
such as equality. They return boolean values, i.e. true
or false
. The comparison operations are nonassociative,
i.e. they cannot be used together as in:
# Wrong! 1 < $x < 2 |
Use boolean operations (see section 13.2.6.5 Boolean Operations) to group comparisons together.
Comparison operations can only be used in conditional expressions.
This table lists all comparison operators in order from highest precedence to lowest (notice, however, the comment after it):
x = y
C
and AWK
programmers, please note single equal sign!
x != y
x < y
x <= y
x > y
x >= y
Operators =
and !=
have equal precedence. Operators
<
, <=
, >
, >=
have equal precedence.
Most operators are defined for all radtest
data types.
However, only =
and !=
are defined for avlist
s.
Using any other comparison operator with avlist
s produces
error.
If x and y are of different data types, their values are first coerced to a common data type, selected using a set of rules (see section 13.2.6.6 Conversion Between Data Types).