envsubst

Substitute environment variables in text

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

Replaces $VAR placeholders in a template with environment values — common in config rendering.

Common flags
FlagMeaning
$VARSLimit substitution to listed variables (argument)
Examples
envsubst '$HOST $PORT' < tpl > outSubstitute only HOST and PORT · explain & risk-check →
Related
sed printf
Open the full explainer →More in Text Processing

Reference text is hand-written and may be incomplete — check man envsubst for your version. Test destructive commands on a non-production system first.