Bad interpreter error – linux shell script
April 15th, 2009I recently encountered this error after modifying a shell script in Windows then FTPing it to a linux server. When executing the script in SSH, I got the following error:
: bad interpreter: No such file or directory
Apparently there are issues with carriage returns and line feeds CR/LF between windows and linux. A simple perl command fixed the issue.
perl -i -pe's/\r$//;' <filename> |