Appendix A. Summary of String Expansion

This appendix contains a list of all the available expansion items, conditions, and variables, in alphabetical order in each case, with brief descriptions. A more detailed discussion of the expansion items and conditions can be found in Chapter 17.

Expansion Items

The following items are recognized in expanded strings. Whitespace may be used between subitems that are keywords or substrings enclosed in braces inside an outer set of braces, to improve readability.

$ variable-name or ${ variable-name }

The contents of the named variable are substituted. An unknown variable name causes an error.

${domain: string }

The string is expanded; it is then interpreted as an RFC 822 address and the domain is extracted from it.

${escape: string }

If the expanded string contains any nonprinting characters, they are converted to escape sequences starting with a backslash.

${expand: string }

The string is expanded twice.

${extract{ key } { string }}

The subfield identified by the key is extracted from the expanded string,

${extract{ number } { separators } { string }}

The subfield numbered number is extracted from the expanded string.

${hash_ n _ m : string }

A textual hash of length n is generated, using characters from the first m characters of the concatenation of lowercase letters, uppercase letters, and digits. See also nhash.

$header_ header-name : or $h_ header-name :

The contents of the named message header are substituted. If there is no such header, ...

Get Exim: The Mail Transfer Agent 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.