Cmder bash脚本执行 [英] Cmder bash script executing
问题描述
我在Windows中创建了基本脚本.
I created basic script in Windows.
#!/bin/bash
echo Hello
我正在使用Cmder,ConEmu衍生物.我试图用chmod更改特权,但是它们是相同的.我不知道如何执行此脚本.普通的Linux方式是:./hello.sh无法正常工作,仅输入hello.sh会使Windows尝试打开它,这很不好,因为我希望在控制台中将其打开.如何在ConEmu/Cmder中执行此脚本?
I am using Cmder, ConEmu derivative. I tried to change the priviliges with chmod, but they are the same. I don't know how can I execute this script. Normal Linux way, which is: ./hello.sh does not work, and typing just hello.sh makes Windows try to open it, which is bad, since I want it in console. How to execute this script in ConEmu/Cmder?
推荐答案
我注意到您可以从 cmder 运行 bash
.所以我可以这样做:
I've noticed you can run bash
from cmder. So I could do it like:
> bash
$ ./yourScript.sh
或更简单
> cat yourScript.sh | bash
免责声明: cmder (刚刚下载)和Linux自己的新手.
Disclaimer: New to cmder (just downloaded it) and Linux myself.
这篇关于Cmder bash脚本执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!