Amos Yuen
Amos Yuen

Reputation: 1459

Why does envsubst replace /

I'm on windows running bash and I can't figure out why this is happening.

I have a variable such as export SOCKET=/socket then when I run echo '$SOCKET' | envsubst I get C:/Program Files/Git/socket. For some reason it is replacing the slash.

Any idea why this is happening? If i look at the output of printenv the only environment variable with Git in the path is EXEPATH=C:\Program Files\Git

Upvotes: 4

Views: 1421

Answers (1)

Amos Yuen
Amos Yuen

Reputation: 1459

Realized once I read @chepner's comment about path mangling that this likely has to do with bash on windows doing a path conversion.

I then tried setting MSYS_NO_PATHCONV=1 which is supposed to prevent path conversion, and now it works fine. Thanks!

Upvotes: 5

Related Questions