我对Cygwin有点陌生,我正在尝试从Batch中在Cygwin中运行shell脚本并获取返回值。我一直在搜索,尝试使用C:\cygwin[64]\bin\bash[64].exe
甚至弄乱,C:\cygwin[64]\Cygwin.bat
但无济于事。
基本上,我只希望能够与bash(来自Cygwin)进行批量交互。如果您觉得这很琐碎,请原谅我,因为我对Cygwin不太熟悉。无论如何,我还没有找到一个可行的在线解决方案。
cygwin-magic "echo shell-command"
#=> shell-command
我经过长时间的Google搜索发现了所有这些东西。我没有想要做的。
"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进行交互。我已经用第三种语言计划了我的解决方案,但这只是批处理到cygwin不能正常工作。
64
在代码中编写所有s是[64]
因为我知道32位版本不使用该代码。也许你"C:\cygwin[64]\bin\basH[64].exe"
不是说"C:\cygwin[64]\bin\base[64].exe"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句