@ExarKunIv try to use dos2unix scriptfile.sh
I think you've wrong line endings.... Because for me the script runs flawless and if it spit out errors then there is likely something wrong with the interpretion of the script caused by wrong LE.
@hhromic thank you, I will tell him. He is currently trying to make an "earthbound" theme resource pack for solarus, then wants to do 2 player co-op. Hopefully someone on Discord can help him out!