From 1d856366af60141017cc40a6091699b408cb0263 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Thu, 12 Apr 2018 17:39:43 +0100 Subject: [PATCH] envsubst: add page (#2064) --- pages/linux/envsubst.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/linux/envsubst.md diff --git a/pages/linux/envsubst.md b/pages/linux/envsubst.md new file mode 100644 index 0000000000..9c3ada8093 --- /dev/null +++ b/pages/linux/envsubst.md @@ -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}}`