Wednesday, June 20, 2012

Fixing /bin/bash^M: bad interpreter: No such file or directory

If you write a bash script in Windows and you get this error after FTP'ing and running it in Linux, try the following to fix it

perl -i -pe's/\r$//;' script_name.sh



3 comments:

  1. I want to follow your blog but i donot see any option here ..please! help me out

    ReplyDelete
  2. What do you mean by not having the option??

    ReplyDelete
  3. Thanks a lot, several other sites had similar lines that just didn't work, nice work!

    ReplyDelete