Bash, Cygwin: Remember the CRLF

This morning I wrote a bash script to find redundant accounts from a database. Writing the actual script was easy, but I ran into a problem with my environment. You see, I use windows. So the text files created in windows have that pesky CRLF line endings. So, whenever I attempted to execute a query to mysql, I would get an error saying that there was no such database.

Since I had ran into a new line problem two days ago, I decided to switch the script format to unix. I did this by doing


:e ++ff=unix
:w

The script worked after that. Bash and mysql wanted to interpret \r. It obviously didn't know what to do, so it would break afterwards.