BASH: bad interpreter: No such file or directory

If you are getting this error message from a linux shell

bad interpreter: No such file or directory

over and over again, may be a “path” variable setting mistake, that is the correct interpreter (e.g. bash) can’t be found and you have to specify the full path. Else the script file has been witten on a win32 machine, so the “end of line” character is ‘\r\n‘ rather than ‘\n‘.

If this last case, you can solve the problem editing the script file with “vim” and digiting:

:set fileformat=unix

and finally to save:

:wq

Leave a Reply

Your email address will not be published.