mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 09:22:07 +02:00
envsubst: clarify examples and description (#3221)
This commit is contained in:
parent
50fe370668
commit
c206938235
1 changed files with 7 additions and 7 deletions
|
@ -1,20 +1,20 @@
|
||||||
# envsubst
|
# envsubst
|
||||||
|
|
||||||
> Substitutes shell format strings with environment variables in text.
|
> Substitutes environment variables with their value in shell format strings.
|
||||||
> Strings to be replaced should be in either `${var}` or `$var` format.
|
> Variables to be replaced should be in either `${var}` or `$var` format.
|
||||||
|
|
||||||
- Replace environment variables in stdin and output to `stdout`:
|
- Replace environment variables in `stdin` and output to `stdout`:
|
||||||
|
|
||||||
`echo '{{$HOME}}' | envsubst`
|
`echo '{{$HOME}}' | envsubst`
|
||||||
|
|
||||||
- Replace environment variables in an input file and output to `stdout`:
|
- Replace environment variables in an input file and output to `stdout`:
|
||||||
|
|
||||||
`envsubst < {{path/to/input}}`
|
`envsubst < {{path/to/input_file}}`
|
||||||
|
|
||||||
- Replace environment variables in an input file and output to a file:
|
- Replace environment variables in an input file and output to a file:
|
||||||
|
|
||||||
`envsubst < {{path/to/input}} > {{path/to/output}}`
|
`envsubst < {{path/to/input_file}} > {{path/to/output_file}}`
|
||||||
|
|
||||||
- Replace environment variables in input from a space-separated list:
|
- Replace environment variables in an input file from a space-separated list:
|
||||||
|
|
||||||
`envsubst {{variables}} < {{path/to/input}}`
|
`envsubst '{{$USER $SHELL $HOME}}' < {{path/to/input_file}}`
|
||||||
|
|
Loading…
Add table
Reference in a new issue