home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

$#

Match a literal $# LHS operator

Because the RHS can return a delivery-agent specification, it is sometimes desirable to check for the $# operator on the LHS of a rule. Consider, for example, the following rule:

R $+ $|  $# OK              $@ $1

The LHS looks for anything (the $+) followed by a $| operator, and then a $# OK. This might match a workspace that was set up by a database-map lookup or a call to another rule set. The $# OK means the address was OK as is, and so should be placed back into the workspace. The RHS does just that by returning (the $@ prefix) the original address (the $1 references the LHS $+, which contained the original address).

Note that the $# operator has no special meaning in the LHS. It is used only to detect a delivery-agent-like specification made by an earlier rule on the RHS. The next two sections reveal how this is done.

    Previous Section Next Section