Multicharacter Command-Line Options

Beginning with V8.7, option names can be single-character or multicharacter. Single-character options are declared with the -o (lowercase) switch as described earlier. Multicharacter options, which are preferred, are declared with a -O (uppercase) switch:

-OLongName=argument       ← beginning with V8.7uppercase

Space can optionally exist between the -O and the LongName. In the command line, space cannot exist between the LongName, the =, and the argument unless they are quoted:

-O "LongName = argument"

Only one option can be specified for each -O switch.

The sendmail program ignores case when it considers multicharacter names. Therefore, the following three command lines have the same effect, and none produces an error:

-OQueueDirectory=/var/spool/mqueue
-Oqueuedirectory=/var/spool/mqueue
-OQuEuEdIrEcToRy=/var/spool/mqueue

Multicharacter names are beneficial because they allow option names to have mnemonic recognition. For example, the multicharacter name ForwardPath, which lists the default path for ~/.forward files, is much more recognizable than the single-character name J.

If an unknown multicharacter option name is specified, the following is logged and printed:

readcf: unknown option name bad name here

Multicharacter name shorthand

Beginning with V8.7, multicharacter names in the command line can be specified by using the fewest unique leftmost characters in the name. For example, you can specify the queue directory with the complete QueueDirectory long ...

Get sendmail, 4th 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.