Add environment interpolation to any YAML, JSON or TOML config file in any Linux, Mac, Windows, FreeBSD, OpenBSD, NetBSD, BIOS based system leveraging Cosmopolitan.
interpolator is designed to replace all matched values with those
defined in the environment. If a match in the environment is not found, no
substitution will occur.
The interpolation tag for interpolator is ${SOME_ENV_VAR}.
You can use interpolator to interpolate using stdin:
cat config.yaml | ./interpolate > interpolated_config.yamlor you can use it to interpolate files:
./interpolate config.yaml interpolated_config.yamluse inline environment variables:
SOME_ENV_VAR=foo cat config.yaml | ./interpolate > interpolated_config.yamlA simple cross platform way to wholesale interpolate environment variables in config files for software that doesn't support it natively.