Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does envsubst replace /

Tags:

bash

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

like image 826
Amos Yuen Avatar asked Oct 26 '25 08:10

Amos Yuen


1 Answers

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!

like image 57
Amos Yuen Avatar answered Oct 27 '25 23:10

Amos Yuen