summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2015-05-23 21:48:26 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2015-05-23 21:48:26 +0100
commit089fc87a02b0c682ace3afc2f597f5e5b3b8f076 (patch)
treeed84ab31f040b6b2dd5d55c76395acba789e2148 /doc
parentdd2a32ad5058ad7831621b99a1eadc264d4982c9 (diff)
New ${env {NAME}} expansion. Bug 1604
Diffstat (limited to 'doc')
-rw-r--r--doc/doc-docbook/spec.xfpt24
-rw-r--r--doc/doc-txt/NewStuff2
2 files changed, 26 insertions, 0 deletions
diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index 752712181..a598ec08b 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -9031,6 +9031,30 @@ When compiling a function that is to be used in this way with gcc,
you need to add &%-shared%& to the gcc command. Also, in the Exim build-time
configuration, you must add &%-export-dynamic%& to EXTRALIBS.
+
+.vitem "&*${env{*&<&'key'&>&*}{*&<&'string1'&>&*}{*&<&'string2'&>&*}}*&"
+.cindex "expansion" "extracting value from environment"
+.cindex "environment" "value from"
+The key is first expanded separately, and leading and trailing white space
+removed.
+This is then searched for as a name in the environment.
+If a variable is found then its value is placed in &$value$&
+and <&'string1'&> is expanded, otherwise <&'string2'&> is expanded.
+
+Instead of {<&'string2'&>} the word &"fail"& (not in curly brackets) can
+appear, for example:
+.code
+${env{USER}{$value} fail }
+.endd
+This forces an expansion failure (see section &<<SECTforexpfai>>&);
+{<&'string1'&>} must be present for &"fail"& to be recognized.
+
+If {<&'string2'&>} is omitted an empty string is substituted on
+search failure.
+If {<&'string1'&>} is omitted the search result is substituted on
+search success.
+
+
.vitem "&*${extract{*&<&'key'&>&*}{*&<&'string1'&>&*}{*&<&'string2'&>&*}&&&
{*&<&'string3'&>&*}}*&"
.cindex "expansion" "extracting substrings by key"
diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff
index aa60f46f1..3fe332556 100644
--- a/doc/doc-txt/NewStuff
+++ b/doc/doc-txt/NewStuff
@@ -33,6 +33,8 @@ Version 4.86
10. A logging option for slow DNS lookups,
+11. New ${env {<variable>}} expansion.
+
Version 4.85
------------