Expand description
Compose-style variable interpolation.
Supported: $VAR, ${VAR}, ${VAR:-default} (unset or empty), ${VAR-default}
(unset only), ${VAR:?message} / ${VAR?message} (error), ${VAR:+alt} /
${VAR+alt}, and $$ for a literal $. Defaults may themselves contain
interpolations. An unset variable with no default is an error, not an empty
string: an empty bind path or label is worse than a failed parse.
Interpolation runs on string scalars (and mapping keys) of the parsed YAML tree, never on the raw text, so a value cannot inject YAML structure.
Functionsยง
- interpolate
- Interpolate
susinglookupfor variable values. - interpolate_
yaml - Interpolate every string scalar and mapping key in a YAML tree, in place.
- parse_
env_ file - Parse a dotenv-style file:
KEY=VALUElines,#comments, optionalexport, optional single or double quotes around the value. No expansion. - references
- The variables
srefers to, in order of appearance (with repeats), the ones inside a default or alternate included: whatinterpolatemay look up. Malformed references are skipped (interpolating reports them).