If you get the error bad interpreter: No such file or directory when trying to run a file in linux, there is a chance that the script has been written using an editor that is not setup correctly - line endings need to be unix compatible.
Try running the 2 below and try the script again!
sed -i -e 's/\r$//' scriptname.sh
sed -i -e 's/^M$//' scriptname.sh