$’\r’: command not found

link

sed -i 's/\r$//' filename.sh