Account Links: Cart | Your Account | Logout

Skip to content

Red Hat Knowledgebase

Red Hat Knowledgebase Search:

Updated Within the Last:

New Solutions within the last day New Solutions within the last week New Solutions within the last month

Browse by topics:


Click to View a Topic
Red Hat Enterprise Linux > Configuration > Issue <<  506 of 606 >>

Solution Tools:


Email a Solution Postcard Printer version Submit a comment on this answer Update notifications Request an answer Back

Article Reference

Article ID: 1264
Last update: 07-16-04
Issue:
How do I fix 'bad interpreter' error messages when trying to run shell scripts?
Resolution:
More often than not, this error indicates that the script in question has been written on a machine which inserted CR/CRLF's into the script (old MS-DOS style newline/linefeeds). Sometimes they appear as ^M's in the file where a newline is defined. Try running the command:
dos2unix <script name>
The command should return a prompt after it completes. Try running the script again to see if the 'bad interpreter' error message has cleared.

Please note that depending on how your editor is configured, the CR/CRLF differences in a file may be invisible.


How well did this entry answer your question?


good wrong incomplete out of date
Red Hat Enterprise Linux > Configuration > Issue <<   506  of  606  >>