Substitutes environment variables with their value in shell format strings. Variables to be replaced should be in either
${var}
or$var
format.
stdin
and output to stdout
:echo '{{$HOME}}' | envsubst
stdout
:envsubst < {{path/to/input_file}}
envsubst < {{path/to/input_file}} > {{path/to/output_file}}
envsubst '{{$USER $SHELL $HOME}}' < {{path/to/input_file}}