mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-07-24 13:15:24 +02:00
envsubst: add page (#2064)
This commit is contained in:
parent
0437cee5f6
commit
1d856366af
1 changed files with 20 additions and 0 deletions
20
pages/linux/envsubst.md
Normal file
20
pages/linux/envsubst.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# 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}}`
|
Loading…
Add table
Reference in a new issue