Running a shell script through Cygwin on Windows

后端 未结 6 1933
有刺的猬
有刺的猬 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:12

    One more thing - if You edited the shell script in some Windows text editor, which produces the \r\n line-endings, cygwin's bash wouldn't accept those \r. Just run dos2unix testit.sh before executing the script:

    C:\cygwin\bin\dos2unix testit.sh
    C:\cygwin\bin\bash testit.sh
    

提交回复
热议问题