"/bin/bash -l" Invalid option

I just encountered this and I had invalid line endings. I changed from CRLF to LF and that fixed it!


You script probably has characters in it that you cannot see. Perhaps it was copy/pasted using the wrong character set translation or is in DOS format. In the case of the latter you can use the tofrodos or dos2unix package to correct.

In either case you could pull it up in 'vi' or another application which will usually show weird characters like ^@ or ^M. You could try cat -v filename which might help see these oddities. Push comes to shove try hexdump (or hd, or od).

Tags:

Bash