!#/bin/bash: No such file or directory

After creating a file on a Windows machine I received an error during execution on a Linux machine:

Error: line 1: !#/bin/bash: No such file or directory

I found two problems which I fixed:

  • The file was using CRLF instead of LF line endings
  • The file was using ‘UTF8 with BOM’ encoding which I converted to ‘UTF8 without BOM’

Leave a Reply