kaniini / envsubst

14 stars 4 forks source link

All text after subsitution is being eaten #3

Open Ikke opened 2 years ago

Ikke commented 2 years ago

Input:

VAR='${VAR}'
${TEST}def

Execution:

VAR=var TEST=abc envsubst <input >output

Output:

VAR='test
abc

Expected:

VAR='test'
abcdef

All text in the input that comes after the substitution is missing.

kaniini commented 2 years ago

interesting.

ghost commented 2 years ago

interesting.

tinco commented 1 year ago

Ran into this bug aswell. Bug is here:

https://github.com/kaniini/envsubst/blob/d2edbca18c87918c9d30bca4626faf3c97a52017/envsubst.c#L187

You only stop consuming the variable name at whitespace, but in regular shells there are more tokens that end a variable name. In this case the ' token and for me it was " that got eaten. Will you be applying a fix @kaniini or are you no longer interested in maintaining this tool? I find it quite useful :)

virusdefender commented 1 year ago

same issue

david0 commented 1 year ago

same here