> In linux.dev.kernel, article <199605031507.QAA26975@snowcrash.cymru.n=
et>,
> Alan Cox <alan@cymru.net> writes:
> > > How would you specify where to find the interpreter? Compiled Ja=
va
> > > doesn't have comments, so you couldn't use the #!-style approach.
> >=20
> > You can add one to the front, you can also use something like the e=
lksemu
> > module that spots elks binaries by magic number, rewrites them to
> > allegedly have #! and passes them to the shell interpreter.
> >=20
> Or you can add a new loader. Use binfmt_scriptshell.c as the example =
to
> follow.=20
>=20
> NB: Why does trying to exec a script with an interpreter that is itse=
lf a
> script cause an error? Specifically, EPERM? I think that should be al=
lowed.
> (Yes I know, other Unixes frequently don't allow this, but that's no
> excuse.)
>=20
> /tmp/foo:
> #!/bin/sh
> echo "Did it"
>=20
> /tmp/bar:
> #!/tmp/foo
> # nothing interesting
>=20
> % chmod +x /tmp/foo /tmp/bar
> % /tmp/bar
> bash: ./bar: Permission denied
> %
Maybe because of
/tmp/bar:
#!/tmp/bar
(loop in the kernel)
>=20
> Hmmm...
>=20
> --=20
> And ever has it been known that
> love knows not its own depth until the hour of separation.
> --Kahlil Gibran
> --=20
> Matthias Urlichs \ Noris Network GmbH i.Gr/ Xlink-POP N=FCrnbe=
rg=20
> Schleiermacherstra=DFe 12 \ Linux+Internet / EMail: urlichs@n=
oris.de
> 90491 N=FCrnberg (Germany) \ Consulting+Programming+Networking+etc=
'ing
> PGP: 1B 89 E2 1C 43 EA 80 44 15 D2 29 CF C6 C7 E0 DE=20
> Click <A HREF=3D"http://info.noris.de/~smurf/finger">here</A>.=
42
>=20
>=20