a8m / envsubst

Environment variables substitution for Go
MIT License
768 stars 83 forks source link

Replaces $1, $2 etc, which are not environment variables #38

Closed Martin4R closed 2 years ago

Martin4R commented 2 years ago

Expressions like $1 get replaced with an empty string, but $1 is by definition no environment variable, because it starts with a digit (See https://stackoverflow.com/a/2821183). This behavior is unexpected different compared to the original gnu envsubst, which does not replace $1.

a8m commented 2 years ago

Thanks for reporting this, @Martin4R. Feel free to send a patch to fix this, or I can do it sometime this week.

a8m commented 2 years ago

Fixed with https://github.com/a8m/envsubst/pull/39