So my nice little bash script wasn't woking on cygwin. What could be wrong? I was getting a weird error saying that my file was not ending correctly.
What was the problem?
Answer: working on Windows.
No, it is not what it sounds! No OS zealotry here! The problem was that my beloved Vim adapts to its environs very well, so it was adding a CrLF at the end of my script file. Cygwin couldn't deal with that, ergo the error. http://stackoverflow.com/questions/630650/errors-on-beginner-bash-script
The solution on vim is easy:
:set fileformat=unix
:w
I found the solution here:
http://www.delphifaq.com/faq/f746.shtml
Bonus! also included in that answer is the following tidbit:
// remove multiple (repeated) Carriage Returns using search and replace
:%s/[^M]$//
:w