The main issue is usually Windows uses CR-LF (Carriage Return + Line Feed) special characters to terminate a line.
Unix/Linux uses LF (Line Feed) to terminate lines.
Mac uses CR (Carriage Return) to terminalte lines.
These special characters cause issues with scripts being interpreted properly. There is also a problem with certain versions where the native text is unicode, which is a multi-byte character set. These characters will look pretty messed up on a single-byte system.
I'm sure you've also taken unix log files and viewed them on windows and just seen a jumbled mess of characters. That is because the LF by itself is not seen as a signal for a newline in windows and basically the whole log file is one big line.
If you want to write your scripts on windows, I suggest you use a text editor which knows how to convert the CR-LF and LF or you use utilities that can convert. Personally I use emacs but I am very old school.
You can find the DOS2UNIX and UNIX2DOS utilities on this page:
They will convert the CR-LF and LF so the files can be read properly.
Use DOS2UNIX if you write your script in notepad, then want to move it to Linux/Android. Use UNIX2DOS if you have a file generated on Linux/Android and you want to view it in Notepad.