Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

26
envsubst Normal file
View File

@@ -0,0 +1,26 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# envsubst
> Substitutes environment variables with their value in shell format strings.
> Variables to be replaced should be in either `${var}` or `$var` format.
> More information: <https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html>.
- 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_file}}`
- Replace environment variables in an input file and output to a file:
`envsubst < {{path/to/input_file}} > {{path/to/output_file}}`
- Replace environment variables in an input file from a space-separated list:
`envsubst '{{$USER $SHELL $HOME}}' < {{path/to/input_file}}`