Hi,
there seems to be some kind of path translation when I call Windows program from inside bash. The translation does /c to C:\ translation so the Windows program can understand the unix mount path.
So far so good, however the translation may also be applied on places where it is not appropriate. For example cmd /c "echo foobar" is actually executed as c:\Windows\system32\cmd.exe c:/ "echo foobar".
Full example:
X:\.gow\bin>bash --version
GNU bash, version 3.1.17(1)-release (i686-pc-msys)
Copyright (C) 2005 Free Software Foundation, Inc.
X:\.gow\bin>bash
bash-3.1$ cmd /c "echo foobar"
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
X:\.gow\bin>exit <-- no echo executed and I had to manually exit, i.e. /c is not honored
bash-3.1$ cmd //c "echo foobar"
foobar <-- all good here, after cmd's echo a bash prompt returns
bash-3.1$ exit
exit
X:\.gow\bin>
Note how adding syntactic error //c yields desired command call. Is this expected behaviour? I would not expect / to be escape character here. In bash it usually is \ and in Windows it is ^.
Hi, there seems to be some kind of path translation when I call Windows program from inside bash. The translation does
/c
toC:\
translation so the Windows program can understand the unix mount path.So far so good, however the translation may also be applied on places where it is not appropriate. For example
cmd /c "echo foobar"
is actually executed asc:\Windows\system32\cmd.exe c:/ "echo foobar"
.Full example:
correct command, unwanted result
bash-3.1$ cmd /c "echo foobar"
=c:\Windows\system32\cmd.exe c:/ "echo foobar"
incorrect command, wanted result
bash-3.1$ cmd //c "echo foobar"
=c:\Windows\system32\cmd.exe /c "echo foobar"
Note how adding syntactic error
//c
yields desired command call. Is this expected behaviour? I would not expect/
to be escape character here. In bash it usually is\
and in Windows it is^
.Is the workaround safe to use?