在 Windows 批处理文件中运行 bash 命令

jb_*_*ado 3 bash shell cmd batch-file sh

是否可以在批处理脚本中运行msys bash 命令?假设我有一个.bat文件,其中有 Windows 批处理命令,并且在一行中我将切换到msys bash 来处理msys指定的命令。就像这样:

[...] 
batch commands 
[...]
C:\mingw\msys\1.0\bin\sh -l
mount 'C:\mingw\local32' /local32
[...] 
bash commands 
[...]
Run Code Online (Sandbox Code Playgroud)

感谢帮助!

jb_

Cos*_*atu 5

为什么不将所有 shell 命令放在一个单独的文件中,然后从批处理文件中的一行中调用该脚本呢?

C:\mingw\msys\1.0\bin\sh your-msys-script.sh
Run Code Online (Sandbox Code Playgroud)