diff options
Diffstat (limited to 'man')
-rw-r--r-- | man/environment.d.xml | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/man/environment.d.xml b/man/environment.d.xml index 4022c25c36..be7758a2f9 100644 --- a/man/environment.d.xml +++ b/man/environment.d.xml @@ -78,8 +78,16 @@ <literal><replaceable>KEY</replaceable>=<replaceable>VALUE</replaceable></literal> environment variable assignments, separated by newlines. The right hand side of these assignments may reference previously defined environment variables, using the <literal>${OTHER_KEY}</literal> - and <literal>$OTHER_KEY</literal> format. No other elements of shell syntax are supported. - </para> + and <literal>$OTHER_KEY</literal> format. It is also possible to use + + <literal>${<replaceable>FOO</replaceable>:-<replaceable>DEFAULT_VALUE</replaceable>}</literal> + to expand in the same way as <literal>${<replaceable>FOO</replaceable>}</literal> unless the + expansion would be empty, in which case it expands to <replaceable>DEFAULT_VALUE</replaceable>, + and use + <literal>${<replaceable>FOO</replaceable>:+<replaceable>ALTERNATE_VALUE</replaceable>}</literal> + to expand to <replaceable>ALTERNATE_VALUE</replaceable> as long as + <literal>${<replaceable>FOO</replaceable>}</literal> would have expanded to a non-empty value. + No other elements of shell syntax are supported.</para> <para>Each<replaceable>KEY</replaceable> must be a valid variable name. Empty lines and lines beginning with the comment character <literal>#</literal> are ignored.</para> @@ -95,8 +103,8 @@ <programlisting> FOO_DEBUG=force-software-gl,log-verbose PATH=/opt/foo/bin:$PATH - LD_LIBRARY_PATH=/opt/foo/lib - XDG_DATA_DIRS=/opt/foo/share:${XDG_DATA_DIRS} + LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}/opt/foo/lib + XDG_DATA_DIRS=/opt/foo/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/} </programlisting> </example> </refsect2> |