Text file line order messed up in terminal
You misconfigured your vimrc and a carriage return (CR or 0x0d) instead of a line feed (LF or 0x0a) is entered/read.

So modify the vimrc back to the standard behavior.

The missing shebang (e.g. #!/bin/bash) at the beginning is not the cause of the failing script. I would include it though - just for redundancy.