Re: Java in OS?

Matthias Urlichs (smurf@smurf.noris.de)
Sun, 5 May 1996 08:14:58 +0100


In linux.dev.kernel, article <199605031507.QAA26975@snowcrash.cymru.net=
>,
Alan Cox <alan@cymru.net> writes:
> > How would you specify where to find the interpreter? Compiled Java
> > 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 elk=
semu
> 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

NB: Why does trying to exec a script with an interpreter that is itself=
a
script cause an error? Specifically, EPERM? I think that should be allo=
wed.
(Yes I know, other Unixes frequently don't allow this, but that's no
excuse.)

/tmp/foo:
#!/bin/sh
echo "Did it"

/tmp/bar:
#!/tmp/foo
# nothing interesting

% chmod +x /tmp/foo /tmp/bar
% /tmp/bar
bash: ./bar: Permission denied
%

Hmmm...

--=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=FCrnberg=
=20
Schleiermacherstra=DFe 12 \ Linux+Internet / EMail: urlichs@nor=
is.de
90491 N=FCrnberg (Germany) \ Consulting+Programming+Networking+etc'i=
ng
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