无法在Windows10上使用Git Bash界面运行shell脚本 [英] Cant run shell script using Git Bash interface on Windows10

查看:595
本文介绍了无法在Windows10上使用Git Bash界面运行shell脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遵循



我可以看到bash程序的即时外观,但无法捕捉文本进去。
我双重检查了路径,他们是正确的。
我通过Git bash运行脚本,一切正常(信息出现)。

任何想法?

之前看过不同的语法。

>

我只看到消息:

  startgit-bash。 exe -i -l -c/C/path/to/script.sh

code> script.sh ,包括暂停

  echo你好。世界! 
read -n1 -r -p按任意键继续...键

OP Hairi 报告 > start / b cmd / cC:/ Program Files / Git / git-bash.exe/C/path/to/script.sh


Following this post I wasn't able run shell trough Git bash. This is the batch file :

%ComSpec% /c ""C:\Program Files\Git\git-bash.exe" --login -i -- C:\Users\rmrd001\Documents\Git\scripts\first\test.sh"
pause

This is the shell script:

echo Hello, World!

And this is what I get when batch is run:

I can see the instantaneous appearance of the bash program, but can't catch the text into it. I double-triple-checked the paths, they are correct. I ran the script trough the Git bash, everything worked well (the message appeared).

Any ideas?

解决方案

I have seen a different syntax before.

I only see the message with:

start "" git-bash.exe -i -l -c "/C/path/to/script.sh"

With script.sh including a pause:

echo Hello. World!
read -n1 -r -p "Press any key to continue..." key

The OP Hairi report in the comments making it work with:

start /b cmd /c "C:/Program Files/Git/git-bash.exe" /C/path/to/script.sh

这篇关于无法在Windows10上使用Git Bash界面运行shell脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆