1@pindex envsubst
2@cindex @code{envsubst} program, usage
3@example
4envsubst [@var{option}] [@var{shell-format}]
5@end example
6
7@cindex shell format string
8@cindex dollar substitution
9@cindex environment variables
10The @code{envsubst} program substitutes the values of environment variables.
11
12@noindent @strong{Operation mode}
13
14@table @samp
15@item -v
16@itemx --variables
17@opindex -v@r{, @code{envsubst} option}
18@opindex --variables@r{, @code{envsubst} option}
19Output the variables occurring in @var{shell-format}.
20
21@end table
22
23@noindent @strong{Informative output}
24
25@table @samp
26@item -h
27@itemx --help
28@opindex -h@r{, @code{envsubst} option}
29@opindex --help@r{, @code{envsubst} option}
30Display this help and exit.
31
32@item -V
33@itemx --version
34@opindex -V@r{, @code{envsubst} option}
35@opindex --version@r{, @code{envsubst} option}
36Output version information and exit.
37
38@end table
39
40In normal operation mode, standard input is copied to standard output,
41with 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
44referenced in @var{shell-format} are substituted; otherwise all environment
45variables references occurring in standard input are substituted.
46
47These substitutions are a subset of the substitutions that a shell performs
48on unquoted and double-quoted strings.  Other kinds of substitutions done
49by a shell, such as @code{$@{@var{variable}-@var{default}@}} or
50@code{$(@var{command-list})} or @code{`@var{command-list}`}, are not performed
51by the @code{envsubst} program, due to security reasons.
52
53When @code{--variables} is used, standard input is ignored, and the output
54consists of the environment variables that are referenced in
55@var{shell-format}, one per line.
56