MSysGit - 直接运行bat文件

问题描述 投票:0回答:3

我安装了新版本的 MSysGit,现在我无法直接从命令行运行 *.bat 文件(“称为 MINGW64”)。

我尝试搜索它,但我只看到需要先运行cmd的选项。 在 git 控制台之外:如何执行批处理文件,然后返回 git 控制台?

cmd "/C clean.bat"

是否有一些选项可以只运行

clean.bat

非常感谢


我通过更新所有库来解决这个问题......也许是 Cygwin?我不确定,但更新所有软件就可以了。

windows cmd msysgit
3个回答
12
投票

从 MINGW 命令行尝试此操作

$ cmd <test.bat

0
投票

从 MINGW 命令行尝试此操作

$ eval "./test.bat"

D:\workspace>echo hello world
hello world

0
投票

除了重定向

cmd < clean.bat
您可能还喜欢:

# Basic case - pipeline
echo clean.bat | cmd

# Feeding two commands - pipeline
echo -e "cd (cygpath -w ~/some_folder)\nclean.bat" | cmd # note the -e switch and \n char...

# For multiline cases the "here document" is the most readable form
cmd << MYEND
:: Here we go
cd `cygpath -w ~/my-folder`
setenv.bat
:: some_other_commands (?)
clean.bat
MYEND
© www.soinside.com 2019 - 2024. All rights reserved.