Sunday 8 June 2014

#!/bin/bash - no such file or directory

This can be cause by an extra carriage return at the end of the first line

execute the following in termial:

head -1 yourscript | od -c

if it ends with \r \n then it is not in the correct format.

if it ends with \n with no \r preceding that, then it is correct.

to fix the file, use dos2linux

sudo apt-get install dos2linux

dos2linux yourscript

No comments:

Post a Comment