Weird shell/interpreter behavior
I'm starting to wonder if I'm losing my mind with respect to
interpreters. I have created a number of programs which should be run
with /usr/bin/mzscheme. To enable this, I made them executable and made
the first line "#!/usr/bin/mzscheme" (with --script, but that doesn't
affect this) I have attached an example.
When I run the program with zsh, it works perfectly.
If I run it with bash, bash tries to load it as a shell script (I'm
not sure if it's sourcing it in the same shell or starting a new one)
I thought this was a strange bashism, but ash and tcsh do the same
thing!
More data points:
* If I change the first line to /usr/bin/python, the system tries (and
of course fails) to run the program with python.
* /usr/bin/mzscheme is a shell script.
I suspect this may be the immediate cause of the problem, but why
should other programs behave strangely because of it?
I guess I have a couple questions: first, why does this depend on the
shell at all? (I thought the kernel or libc handled #!); second, is this
a real bug; third, where should I report the bug? mzscheme, bash, ash,
zsh, or some other package (the kernel?)
Thanks,
Daniel
--
/-------------------- Daniel Burrows <dburrows@debian.org> -------------------\
| You will soon forget this. |
\---- Be like the kid in the movie! Play chess! -- http://www.uschess.org ---/
#!/usr/bin/mzscheme
(define test "Hello, world!~n")
(printf test)
Reply to: