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