File: rt-envsubst.texi

package info (click to toggle)
gettext 0.23.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 168,104 kB
  • sloc: ansic: 532,579; sh: 68,252; perl: 28,011; makefile: 9,068; lisp: 3,184; yacc: 1,055; java: 615; cs: 589; cpp: 397; objc: 343; sed: 79; tcl: 63; xml: 40; pascal: 11; awk: 7; php: 7
file content (59 lines) | stat: -rw-r--r-- 1,983 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@c This file is part of the GNU gettext manual.
@c Copyright (C) 1995-2019 Free Software Foundation, Inc.
@c See the file gettext.texi for copying conditions.

@pindex envsubst
@cindex @code{envsubst} program, usage
@example
envsubst [@var{option}] [@var{shell-format}]
@end example

@cindex shell format string
@cindex dollar substitution
@cindex environment variables
The @code{envsubst} program substitutes the values of environment variables.

@noindent @strong{Operation mode}

@table @samp
@item -v
@itemx --variables
@opindex -v@r{, @code{envsubst} option}
@opindex --variables@r{, @code{envsubst} option}
Output the variables occurring in @var{shell-format}.

@end table

@noindent @strong{Informative output}

@table @samp
@item -h
@itemx --help
@opindex -h@r{, @code{envsubst} option}
@opindex --help@r{, @code{envsubst} option}
Display this help and exit.

@item -V
@itemx --version
@opindex -V@r{, @code{envsubst} option}
@opindex --version@r{, @code{envsubst} option}
Output version information and exit.

@end table

In normal operation mode, standard input is copied to standard output,
with references to environment variables of the form @code{$VARIABLE} or
@code{$@{VARIABLE@}} being replaced with the corresponding values.  If a
@var{shell-format} is given, only those environment variables that are
referenced in @var{shell-format} are substituted; otherwise all environment
variables references occurring in standard input are substituted.

These substitutions are a subset of the substitutions that a shell performs
on unquoted and double-quoted strings.  Other kinds of substitutions done
by a shell, such as @code{$@{@var{variable}-@var{default}@}} or
@code{$(@var{command-list})} or @code{`@var{command-list}`}, are not performed
by the @code{envsubst} program, due to security reasons.

When @code{--variables} is used, standard input is ignored, and the output
consists of the environment variables that are referenced in
@var{shell-format}, one per line.