Name

-m

Synopsis

Ordinarily, a successful lookup in a database map causes the key to be replaced by its value. When the intention is to merely verify that the key exists (not replace it), the -m switch can be used to suppress replacement.

For example, the values that are returned from the hosts.byname NIS database map are not generally useful (they contain multiple hostnames). In looking up a key in this database map (with $( and $), Section 23.4), the -m switch prevents those multiple names from wrongly replacing the single hostname in the key. Note that the -a switch (-a) can still be used to append a suffix to a successful lookup. Also, the $:default (Section 23.4.1) is still used if the lookup fails.

Get Sendmail, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.