Forrest logo
back to the envsubst tool

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:

  1. ${path-to-input_file} refers to the path of the input file that you want to process.
  2. The < symbol is for input redirection, meaning it takes the content of the file specified by ${path-to-input_file} as the input for the envsubst command.
  3. envsubst processes the input, replacing any occurrences of environment variables in the file with their respective values.
  4. The > symbol is for output redirection, meaning it takes the processed output from envsubst 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.
back to the envsubst tool