#!/bin/bash^M
That is, a non-printing carriage return after "bash"
and running the shell script "helpfully" kept telling me: "/bin/bash: no such file or directory"
#!/bin/bash^M
That is, a non-printing carriage return after "bash"
and running the shell script "helpfully" kept telling me: "/bin/bash: no such file or directory"
/bin/bash
: No such file or directory
(Not that that's more helpful to a user, but at least a trained eye would immediately get very suspicious.)...since there's more than 2 valid line ending configurations?
The "bad interpreter" being there or not might be OS-specific, though. Unless some bash versions use fork+execve vs. posix_spawn or similar and that makes a difference there. I haven't checked. Overall I can see how even some current stuff might give the confusing message...
All I can guess is that in terminal, when that particular version of bash and OS interacted, it didn't go back to the start of line, and the CR was unprintable, so it all ended up on the same line.
I'd expect to have seen something like what you describe with the line break, if it were a bare LF, but in my case, it wasa bare CR.
: No such file or directory
(And the rest still applies.)