Oh, wait a minute!
How are you copying/pasting the scripts?
Are you using "Windows Notepad"?
Don't!
Install Notepad++ which correctly deals with "Unix style" (uses LF instead of CR/LF line endings).
You can also use "Unix style" on any text file for Windows too.
"Unix style" should be your choice always.
Load your script in Notepad++. It will say either "DOS" or "Unix" in the bottom status bar.
https://notepad-plus-plus.org/downloads/
And/or:
Code:
$ dos2unix /data/local/tmp/alpha.sh
And you have to give credit to *nix for being so bloody-minded.
It could just say, "Oh, jeez, another ^M coming before ^J again. I guess that I'll ignore it."
In Windows, under Settings > Apps > Apps & Features > Optional Features > Notepad > Uninstall!