Running a shell script through Cygwin on Windows

后端 未结 6 1927
有刺的猬
有刺的猬 2020-12-07 18:14

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, bu

6条回答
  •  轮回少年
    2020-12-07 19:11

    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
    

    ... which can be included in a .bat file as easily as it can be typed at the command line, and with the same effect.

提交回复
热议问题