The syntax for a filter can be defined as a filter item or as a recursive filter. The syntax for a filter item is as follows:
attribute-type operator attribute-value
Table B-1: Allowable Filter Item Operators
Operator | Description |
= = |
Matches string for equality (string, integer, etc.). |
= * |
Matches string for first part of a value. |
*= |
Matches string for last part of a value. |
*=* |
Matches string for any part of a value (i.e., a substring) |
> = |
Matches for a value greater than that specified. |
< = |
Matches for a value less than that specified. |
-f job-owner==userName
There is one unary operator, with the following syntax:
attribute-type operator
Table B-2: Allowable Unary Filter Item Operator
Operator | Description |
* |
Matches for attribute being present (any value). |
-f 'message*'
The syntax for a filter item is as follows:
Table B-3: Allowable Filter Operators
Precedence | Operator |
filter-item && filter |
the "and" operator |
filter-item || filter |
the "or" operator |
!(filter) |
The "not" operator |
(filter) |
Use parentheses to group items for precedence. |
Table B-4 lists the order of precedence for the allowable operators.
Each attribute-value in a filter text must be a single value.
You can use &&
and || to include multiple values.
Remember that you can use the parentheses
to group items for precedence.
Table B-4: Operator Order of Precedence
Precedence | Operator |
1 |
() |
2 |
<=, >=, ==, =*, *=* , *=, * |
3 |
! |
4 |
&& |
5 |
|| |
To list all of John's print jobs that use anything other than North American letter size paper, specify the following filter expression:
-f "(user-name==John) && !(media-used==a)"
To list all printers that have a message posted, use the following filter text (single quotes are required here):
-f 'message*'
To list all documents that have a copy-count greater than 1, specify the following filter text:
-f "copy-count>=1"