One potential issue when editing scripts in Windows is that DOS/Windows uses different line endings than *nix systems. Windows uses carriage return (Ctrl+M, ^M, or \r) and newline (Ctrl+J, ^J, or \n) pairs, and Linux only uses the newline. So sometimes the problem is not that the shell cannot find /bin/bash in the shebang line, it is that it cannot find "/bin/bash^M", but the ^M is invisible as a carriage return and may even overwrite part of the error message making the problem tough to figure out.
Try this for example:
Code: Select all
echo -e "how is that\rno not really"
Whereas, following both appear to output the same even though one has carriage return and one does not:
Code: Select all
echo -e "line 1\r\nline 2"
echo -e "line 1\nline 2"
If you
mkdir bin in your home user directory, the next time you login the default .profile will automatically include /home/your_username/bin in your $PATH (at least in the text console), so that is a good place to put personal scripts to run by script name without any path (as long as the 1st line is a proper shebang line). What I have not figured out is what strips my ~/bin from my PATH when I startx (ie, in lxterminal).