@richard-wise Right that is usually the case when windows is involved. There are a couple of ways to side step the issue.
Not use windows at all. Use Notepad++ on windows Once the file gets to linux unaltered, use the linux command dos2unix to scrub out any remaining Windows bits left behind.With that said, well done on the debugging!!.