如何在Windows 7命令提示符下运行.sh ?当我试着在里面运行这一行的时候总是会得到这个错误,

app/build/build.sh

错误,

'app' is not recognized...

or,

bash app/build/build.sh

错误,

'bash' is not recognized...

知道我错过了什么吗?

这里是截屏,


当前回答

我使用Windows 10 Bash shell,也就是Linux子系统,也就是Windows 10中的Ubuntu

其他回答

Windows中的新功能-在Windows的ubuntu上运行bash -在Build会议后的Windows 10“Insiders”版本中可用:

https://blogs.windows.com/buildingapps/2016/03/30/run-bash-on-ubuntu-on-windows/

在Windows 10周年更新中,在ubuntu上运行shell命令甚至更容易

我试图为我的x-wrt r7000 netgear路由器设置我的区域,我发现以下对我有用,在windows上使用ubuntu上的bash,你必须启用在windows功能中找到的子系统,并开启开发模式

ssh admin@192.168.1.1 < /mnt/c/ccode-eu.sh

你也可以使用cder

Cmder是一个纯粹出于对Windows上缺少良好的控制台模拟器的不满而创建的软件包。它是基于惊人的软件,并与Monokai配色方案和自定义提示布局,从一开始看起来性感

cmder.net

您是否尝试过通过对.sh所在的根目录进行压缩以从那里执行它,而不是像您在问题中所示的那样写下文件的路径?

像这样:

$ cd app/build
$ build.sh

我使用Windows 10 Bash shell,也就是Linux子系统,也就是Windows 10中的Ubuntu