Comparison functions
Comparison functions can be used in conjunction with global variables to test fields, device names, and other specialized functions. (See next section for a description of global variables.) Comparisons are typically joined with other expressions with logical operators, previously described. Each operator in the following table requires a left and right value.
eq operator | The left value must be precisely equal to the right value, ignoring any letter case. |
ne operator | The left value must be different from the right operator, ignoring any letter case. |
lt operator | The left and right values must both be numbers or begin with numbers. Returns true if the left value is less than the right value. If either the left or the right value is not a number, they are regarded as a numeric zero. |
le operator | Similar to the lt operator, except the comparison is less than or equal to. The left and right values must both be numbers or begin with numbers. Returns true if the left value is less than or equal to the right value. If either the left or right values are not numbers, they are regarded as a numeric zero. |
gt operator | The left and right values must both be numbers or begin with numbers. Returns true if the left value is greater than the right value. If either the left or right values are not numbers, they are regarded as a numeric zero. |
ge operator | Similar to the gt operator, except the comparison, is greater than or equal to. The left and right values must both be numbers or begin with numbers. Returns true if the left value is greater than or equal to the right value. If either the left or right values are not numbers, they are regarded as a numeric zero. |
llt operator | This performs an alphabetical comparison of the left and right values. Returns true if the left value is alphabetically less than the right value, ignoring the case. |
lle operator | Similar to the llt operator, except the comparison is alphabetically less than or equal to. Returns true if the left value is alphabetically less than or equal to the right value, ignoring the case. |
lgt operator | This performs an alphabetical comparison of the left and right values. Returns true if the left value is alphabetically greater than the right value, ignoring the case. |
lge operator | Similar to the lgt operator, except that the comparison is alphabetically greater than or equal to. Returns true if the left value is alphabetically greater than or equal the right value, ignoring the case. |
in operator | This operator tests to see if the keyword or wildcard contained in the left value is found in the right value. This is similar to the correlation expressions discussed previously but confined to the value contained in the right value. |
not in operator | The same as the in operator, except that the comparison returns true if the left value keyword or wildcard is not in the right value. |
Related topic