:

$:

Specify a default database-map value RHS database operator

When looking up information with the $( and $) operators it is sometimes desirable to provide a default return value, should the lookup fail. Default values are specified with the $ : operator, which fits between the $( and $) operators like this:

 LHS....      $(  name key $:  default  $)  

Here, name is the symbolic name you associated with a dbtype (Section 23.2.2) using the K configuration command. The key is the value being looked up, and default is the value to be placed in the workspace if the lookup fails.

To illustrate , consider the following rule:

 R $+ < @ $* . fax >        $:  < @ $(faxdb  $: faxhost $) > 

Here, any address that ends in .fax (such as bob@here.fax ) has the host part ( $* or the here ) looked up in the faxdb database (the $2 is the key). If that host is not found with the lookup, the workspace is changed to user <@faxhost> (or, for our example, bob@faxhost ).

See Section 23.4.1 for a complete description of the $ : operator as it is used with database maps.



Sendmail
sendmail, 4th Edition
ISBN: 0596510292
EAN: 2147483647
Year: 2002
Pages: 1174

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net