2
@cindex @code{envsubst} program, usage
4
envsubst [@var{option}] [@var{shell-format}]
7
@cindex shell format string
8
@cindex dollar substitution
9
@cindex environment variables
10
The @code{envsubst} program substitutes the values of environment variables.
12
@noindent @strong{Operation mode}
17
@opindex -v@r{, @code{envsubst} option}
18
@opindex --variables@r{, @code{envsubst} option}
19
Output the variables occurring in @var{shell-format}.
23
@noindent @strong{Informative output}
28
@opindex -h@r{, @code{envsubst} option}
29
@opindex --help@r{, @code{envsubst} option}
30
Display this help and exit.
34
@opindex -V@r{, @code{envsubst} option}
35
@opindex --version@r{, @code{envsubst} option}
36
Output version information and exit.
40
In normal operation mode, standard input is copied to standard output,
41
with references to environment variables of the form @code{$VARIABLE} or
42
@code{$@{VARIABLE@}} being replaced with the corresponding values. If a
43
@var{shell-format} is given, only those environment variables that are
44
referenced in @var{shell-format} are substituted; otherwise all environment
45
variables references occurring in standard input are substituted.
47
These substitutions are a subset of the substitutions that a shell performs
48
on unquoted and double-quoted strings. Other kinds of substitutions done
49
by a shell, such as @code{$@{@var{variable}-@var{default}@}} or
50
@code{$(@var{command-list})} or @code{`@var{command-list}`}, are not performed
51
by the @code{envsubst} program, due to security reasons.
53
When @code{--variables} is used, standard input is ignored, and the output
54
consists of the environment variables that are referenced in
55
@var{shell-format}, one per line.