![Forrest logo](/images/logo.png)
envsubst:tldr:c373b
envsubst: Replace environment variables in an input file and output to a file.
$ envsubst < ${path-to-input_file} > ${path-to-output_file}
try on your machine
The command envsubst
is used for substituting environment variables in a file.
Here is the breakdown of the command:
${path-to-input_file}
refers to the path of the input file that you want to process.- The
<
symbol is for input redirection, meaning it takes the content of the file specified by${path-to-input_file}
as the input for theenvsubst
command. envsubst
processes the input, replacing any occurrences of environment variables in the file with their respective values.- The
>
symbol is for output redirection, meaning it takes the processed output fromenvsubst
and writes it to the file specified by${path-to-output_file}
.
In summary, the command takes the content of the input file, substitutes the environment variables with their values, and writes the result to the output file.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.