msys - Why does MSYS2 not parse a batch file on Windows? -


in order avoid retyping long command msys configuration, use batch file store command looks below: ./configure \ --arch=x86_64 \ --target-os=win64 \ --toolchain=msvc \ --enable-cross-compile \ --enable-gpl \ --disable-debug \ --enable-shared \

this way works msys. when ran batch file in msys2, traced out many error messages like:

'.' not recognized internal or external command, operable program or batch file. '--arch' not recognized internal or external command, operable program or batch file. etc...

can explain me cause is?

as you've shown it, "batch" file looks more bourne shell script, should not qualified .bat file. now, if have qualified .bat file, msys won't able run directly such; needs shebang line make executable shell script. error messages you've shown, appears msys2 may trying clever, in way msys not, handing execution off windows command interpreter, (those cmd.exe error messages); since script in bourne shell syntax, want msys2 run directly such, in bash.

btw, msys shell is bash; afaik, msys2 provides bash primary shell.


Comments