如何在Windows命令提示符下运行.SH? [英] How to run .sh on Windows Command Prompt?

查看:285
本文介绍了如何在Windows命令提示符下运行.SH?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能在Windows 7上运行命令提示符.SH?当我尝试在运行它此行中我总是得到这个错误,

How can I run .sh on Windows 7 Command Prompt? I always get this error when I try to run this line in it,

app/build/build.sh

错误

'app' is not recognized...

bash app/build/build.sh

错误

'bash' is not recognized...

任何想法我错过了?

Any ideas what have I missed?

下面的屏幕抓取,

Here the screen grab,

推荐答案

该错误消息表明您还没有安装庆典,或者它是不是在你的 PATH

The error message indicates that you have not installed bash, or it is not in your PATH.

顶谷歌命中是 http://win-bash.sourceforge.net/ 但你也需要明白,大多数的bash脚本期待一个类似Unix的环境;所以刚安装的Bash可能是不太可能让你跑你在网上发现了一个脚本,除非它给这个特殊的使用方案是专门设计。通常的解决办法是 https://www.cygwin.com/ 的但也有许多可能的选择,这取决于究竟是什么要完成的任务。

The top Google hit is http://win-bash.sourceforge.net/ but you also need to understand that most Bash scripts expect a Unix-like environment; so just installing Bash is probably unlikely to allow you to run a script you found on the net, unless it was specifically designed for this particular usage scenario. The usual solution to that is https://www.cygwin.com/ but there are many possible alternatives, depending on what exactly it is that you want to accomplish.

如果Windows不是中央对您的使用情况下,安装一个免费的OS(或许虚拟化)可能是前进的最简单的方法。

If Windows is not central to your usage scenario, installing a free OS (perhaps virtualized) might be the simplest way forward.

第二错误消息是由于这样的事实的Windows名义上接受向前作为目录分隔符削减,但在这种情况下,它是被PTED作为开关隔板间$ P $。换句话说,视窗分析你的命令行应用程序/构建/build.sh (或与Unix的选项公约意译,应用--build --build.sh )。你可以尝试应用程序\\编译\\ build.sh ,但也正是因为上述情况不大可能奏效。

The second error message is due to the fact that Windows nominally accepts forward slash as a directory separator, but in this context, it is being interpreted as a switch separator. In other words, Windows parses your command line as app /build /build.sh (or, to paraphrase with Unix option conventions, app --build --build.sh). You could try app\build\build.sh but it is unlikely to work, because of the circumstances outlined above.

这篇关于如何在Windows命令提示符下运行.SH?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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