Why executing script system prints "line X: $'\r': command not found"
Issue
- Running custom made script uploaded to the system ends up with errors
# ./script.sh
bash: ./script.sh: /bin/bash^M: bad interpreter: No such file or directory
#
# sh ./script.sh
script.sh: line 2: $'\r': command not found
Environment
- Red Hat Enterprise Linux
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.