Shell script error - bad interpreter messages and solution
. I have downloaded some shell script but when I try to run these shell scripts I get error bad interpreter... How do I fix this error?
A. Make sure you have required shell installed. Each shell script specifies default interpreter at top of the script. For example, consider following script:
#!/bin/sh
# This is...
clear
A=`pwd`
...
.....
...
#!/bin/sh is default interpreter to execute this script. Use ls command to verify that you have /bin/sh installed
$ ls /bin/sh
If /bin/sh is not installed, use rpm, up2date or apt-get command to install required shell.
Another problem is if script was edited or written on MS-DOS platform, you will see CR/CRLF in script. Use dos2unix command to convert theses scripts to UNIX format.
dos2unix script-file-name
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- How do I find file fragmentation for specific file under Linux?
- Download and Install csh / tcsh shell on Linux
- RAID for Linux file server for the best READ and WRITE performance
- Why does my rpm command hangs?
- BASH: Prepend A Text / Lines To a File
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!



Recent Comments
Today ~ 5 Comments
Today ~ 1 Comment
Yesterday ~ 1 Comment
Yesterday ~ 2 Comments
Yesterday ~ 10 Comments