Don't know if anyone made this discovery yet....
I had the same problem and made the following discovery
about the script I was trying to execute but was receiving the 'bad interpreter' message (Redhat Linux 7.3].
The script looked fine when I opened it in vi, btw.
and I could execute the script fine by calling it directly with
perl (it was a perl script).
When you invoke vi in Linux, the editor "vim" is invoked
(because of the alias vi=vim).
vim recognizes both dos and unix file formats.
When I vi'd the file, it appeared fine but the
fileformat (when you first open) stated the file was [dos].
I issued command ":set fileformat=unix" in vi (vim) and
saved. After that, the script ran fine.
Bottom line is the file hae the dos end-of-line character(s) instead
of the unix newline. I guess Perl handles the dos format but bash
does not.
|