我对Cygwin有点新,我试图从批处理中运行Cygwin的shell脚本,并获得返回值。 我一直在四处search,我尝试使用C:\cygwin[64]\bin\bash[64].exe
甚至与C:\cygwin[64]\Cygwin.bat
但无济于事。
基本上,我只是希望能够从批处理,与bash(从Cygwin)进行交互。 请原谅,如果这对你来说似乎是微不足道的,因为我对Cygwin来说相当陌生。 无论如何,我还没有find一个在线工作的解决scheme。
cygwin-magic "echo shell-command" #=> shell-command
我从长时间的Googlesearch中发现了所有这些东西。 没有做到我想要的。
"C:\cygwin[64]\bin\base[64].exe" /cygdrive/c/users/<me>/desktop/tmp.sh #=> ZWNobyAiaGVsbG8i "C:\cygwin[64]\bin\base[64].exe" -d /cygdrive/c/users/<me>/desktop/tmp.sh #=> y▒h/usr/bin/base[64]: invalid input "C:\cygwin[64]\bin\base[64].exe" -d -i /cygdrive/c/users/<me>/desktop/tmp.sh #=> y▒h▒▒e/usr/bin/base[64]: invalid input "C:\cygwin[64]\bin\base[64].exe" -d -i "echo hello" #=> /usr/bin/base[64]: echo hello: No such file or directory # I kind of gave up on all of my other attempts and tried this because why not? Surprise surprise, it didn't work (not that I expected it to). "C:\cygwin[64]\Cygwin.bat" echo "hello"
只是,
echo "hello"
我想批量处理这个问题的原因是我想通过批处理(在Windows上)从另一种语言与bash进行交互。 我已经用第三种语言计划了我的解决scheme,但是这只是批处理到cygwin的工作。
64
[64]
因为我知道32位构build不使用它。 也许你的意思是"C:\cygwin[64]\bin\basH[64].exe"
不是"C:\cygwin[64]\bin\base[64].exe"