Monday, April 10, 2006

shell script 'bad interpreter'

tomcat "bad interpreter" sh shell

Can't execute the shell script on linux. Everything seems in fine. The environment variables required by the script, the $PATH and the script has user has execute permission on the script (chmod +x

Error each time is
bad interpreter: No such file or directory

DOS/Non-Ascii characters in the script! Not sure vi doesn't highlight this (as ^M for example) - it could be a quirk with that version of vi or the console being used (putty in this case).

The solution is simple:

Try again via:
./ run

All works.