On Mon, 10 Nov 2003, Sheldon Hearn wrote:
> The docs suggest that lsearch can't be used in this way, because an
> lsearch expects the file to contain
>
> key colon [whitespace] value
Value is optional (result is the null string). Colon is optional. From
TFM:
. lsearch: The given file is a text file that is searched linearly for a
line beginning with the key, terminated by a colon or white space or the
end of the line. The first occurrence that is found in the file is used.
White space between the key and the colon is permitted. The remainder of
the line, with leading and trailing white space removed, is the data.
This can be continued onto subsequent lines by starting them with any
amount of white space, but only a single space character is included in
the data at such a junction. If the data begins with a colon, the key
must be terminated by a colon, for example:
baduser: :fail:
Empty lines and lines beginning with # are ignored, even if they occur in
the middle of an item. This is the traditional textual format of alias
files. Note that the keys in an lsearch file are literal strings. There
is no wildcarding of any kind.
In most lsearch files, keys are not required to contain colons and |
whitespace. However, if you need this feature, it is available. If a key |
begins with a doublequote character, it is terminated only by a matching |
quote (or end of line), and the normal escaping rules apply to its |
contents (see section 6.12). An optional colon is permitted after quoted |
keys (exactly as for unquoted keys). There is no special handling of |
quotes for the data part of an lsearch line. |
--
Philip Hazel University of Cambridge Computing Service,
ph10@??? Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book: http://www.uit.co.uk/exim-book