mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 16:22:08 +02:00
20 lines
596 B
Markdown
20 lines
596 B
Markdown
# envsubst
|
|
|
|
> Substitutes shell format strings with environment variables in text.
|
|
> Strings to be replaced should be in either `${var}` or `$var` format.
|
|
|
|
- Replace environment variables in stdin and output to stdout:
|
|
|
|
`echo '{{$HOME}}' | envsubst`
|
|
|
|
- Replace environment variables in an input file and output to stdout:
|
|
|
|
`envsubst < {{path/to/input}}`
|
|
|
|
- Replace environment variables in an input file and output to a file:
|
|
|
|
`envsubst < {{path/to/input}} > {{path/to/output}}`
|
|
|
|
- Replace environment variables in input from a space-separated list:
|
|
|
|
`envsubst {{variables}} < {{path/to/input}}`
|