通过Cygwin的运行shell脚本在Windows [英] Running a shell script through Cygwin on Windows
问题描述
我有一堆用于Linux机器上运行shell脚本。现在,我们已经切换到Windows,我需要有运行这些脚本。我有的安装 Cygwin的,但有一种方法,使使用Cygwin脚本运行,但在调用时从Windows批
I have a bunch of shell scripts that used to run on a Linux machine. Now, we've switched over to Windows, and I need to run these scripts there. I have Cygwin installed, but is there a way to make the script run using Cygwin, but the call is made from Windows batch?
推荐答案
当然。在我的(pretty香草)Cygwin的设置,庆典
是 C:\\ cygwin的\\斌
这样我就可以运行庆典
脚本(比如 testit.sh
)使用如下命令Windows批处理文件:
Sure. On my (pretty vanilla) Cygwin setup, bash
is in c:\cygwin\bin
so I can run a bash
script (say testit.sh
) from a Windows batch file using a command like:
C:\cygwin\bin\bash testit.sh
...可以包括在的.bat
文件一样容易,因为它可以在命令行中键入,并用同样的效果。
... which can be included in a .bat
file as easily as it can be typed at the command line, and with the same effect.
这篇关于通过Cygwin的运行shell脚本在Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!