有没有办法在Windows上运行的bash脚本? [英] Is there a way to run Bash scripts on Windows?

查看:234
本文介绍了有没有办法在Windows上运行的bash脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经买了,我使用的是Windows 7旗舰版,我喜欢用它来开发应用程序。一个向下侧(与每一个OS)是,我不能运行的bash脚本。有没有办法通过安装一些软件在Windows上运行的bash脚本?这是确定的,如果它不能正常工作100%,但只要最常见的功能都可用它应该是巨大的。

I have bought and I use Windows 7 Ultimate, and I like to use it to develop applications. One of the down sides (as with every OS) is that I can not run Bash scripts. Is there a way to run Bash scripts on Windows by installing some software? It is ok if it does not work 100%, but as long as the most common functionality is available it should be great.

推荐答案

安装Cygwin,其中包括许多其他的GNU和Unix工具中的Bash(没有他们,其不太可能bash中是非常有用的反正)。

Install Cygwin, which includes Bash among many other GNU and Unix utilities (without whom its unlikely that bash will be very useful anyway).

另一个选择是的MinGW的MSYS 其中包括bash和一组较小的这种更重要的公用事业作为AWK。我个人有preferred Cygwin的,因为它包括这样繁重的工具,Perl和Python,我觉得我的生活不能没有,而MSYS敷衍了事这些并假设你要自己安装它们。

Another option is MinGW's MSYS which includes bash and a smaller set of the more important utilities such as awk. Personally I would have preferred Cygwin because it includes such heavy lifting tools as Perl and Python which I find I cannot live without, while MSYS skimps on these and assumes you are going to install them yourself.

更新
如果有人有兴趣在这个答案,并运行微软Windows 10,请注意在MS-Windows 10有一个的 Windows子系统对于Linux 功能,它 - 一旦启用 - 允许你安装Ubuntu的用户模式的图像,然后在运行猛砸。这提供了100%的兼容性与Ubuntu进行调试和运行bash脚本,但这种设置是从Windows完全独立的,你不能使用的bash脚本使用Windows功能(如流程和API),除了通过<有限访问文件交互HREF =htt​​ps://blogs.msdn.microsoft.com/wsl/2016/06/15/wsl-file-system-support/相对=nofollow> DrvFS 功能。

Updated: If anyone is interested in this answer and is running MS-Windows 10, please note that MS-Windows 10 has a "Windows Subsystem For Linux" feature which - once enabled - allows you to install a user-mode image of Ubuntu and then run Bash on that. This provides 100% compatibility with Ubuntu for debugging and running Bash scripts, but this setup is completely standalone from Windows and you cannot use Bash scripts to interact with Windows features (such as processes and APIs) except for limited access to files through the DrvFS feature.

这篇关于有没有办法在Windows上运行的bash脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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