Locants may be either date/time specifications or search patterns. Dates can be any of the standard human readable forms: mm, dd, yyyy, mm/dd/yy, mm-dd-yy, and so on. The time is hh:mm:ss. It is also possible to specify the separate elements as: sec=nn, min=nn, hour=nn, mday=mm, mon=nn or mon=mmm, year=nn[nn], wday=n or wday=ddd, yday=nnn.
Dates and times are interpreted with some degree of intelligence and flexibility. A date without a time is assumed to mean midnight of the specified date, that is, Oct. 11, 97 and 10/11/97 are assumed to be 10/11/97 00:00:00. A month and a day without a year are assumed to be in the current year unless this would put it more than one month in the future, when it is assumed to be the previous year. For example, assuming that it is currently Mar. 3, 98, if you specify 02/15, it is assumed to be 02/15/98. If you specify 11/3, it is assumed to be 11/03/97, since 11/03/98 would put it more than one month in the future, which is unlikely to be what the user had intended. You can force the proper interpretation of any date by fully specifying it, in other words, adding the day of the month and the year.
If the item=xxx form is used, all elements not specified default to *, hence wday=Sun means all messages on any Sunday.
WARNING:
Do not mix standard format with the item=xxx format. The results are unpredictable.
Spaces should be enclosed in quotes, such as -a"7/14/87 05:08:30"
. Search patterns are enclosed in forward slashes ( / ), with an optional repetition count following, such as -z/GEN006/2 means the second message containing GEN006. The repetition count has no meaning with the -s or -q locant, but does for the -a and -z locants.
You can reverse the meaning of locants by preceding them with an exclamation point ( ! ), for example "-s!/{pattern}/"
means everything that does not match the pattern. Normally -s and -q locants logically OR together if there is more than one. It is possible to AND them together be adding a plus ( + ) sign immediately following the s or q for the second and subsequent locant that is to be OR'ed together. For example: "-s/GEN006/" "-s+!/New York/"
would mean "on messages containing GEN006, but not containing New York." It is also possible to apply search locants to specific fields of a message by specifying a synthetic field and an equal sign prior to the search pattern. For example: "-s@sym@=!/LG_BADARGS/"
means all messages that aren't of type LG_BADARGS.
The search capability supports two different languages. The default language is compatible with the standard sh syntax and supports the meta-search constructs shown in the following table:
Construct |
Description |
^ |
Beginning of message |
$ |
End of message |
* |
Any number of unspecified characters |
? |
A single unspecified character |
[xxx] |
Any character in the list xxx |
[!xxx] |
Any character NOT in the list xxx |
\chr |
Normal C backslash conventions, \n \t \b \f \r \NNN \\ \[ |
The second search language uses the standard regular expression syntax. It is in effect when the -R flag is specified. It supports the constructs shown in the following table:
Construct |
Description |
^ |
Beginning of message |
$ |
End of message |
. |
A single unspecified character |
[xxx] |
Any character is the list xxx, where xxx may include ranges of characters: A-Z, and so on |
[^xxx] |
Any character NOT in the list xxx |
chr* |
Any number of occurrences of chr including 0 |
chr+ |
Any number of occurrences of chr with a minimum of 1 |
chr{m,n} |
From m to n occurrences of chr |
\chr |
Normal C backslash conventions, \n \t \b \f \r \NNN \\ \[ |
(pat) |
Parentheses serve to group portions of a pattern. {pat} can be any legal pattern of its own. The asterisk ( * ), plus ( +), and {m,n} operators can be applied to the entire grouping within the parentheses, that is, ([bB]ob)+ means one or more occurrences of bob or Bob. |