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 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
