> On 5 May 96 at 8:14, Matthias Urlichs wrote:
>=20
> > 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 approac=
h.
> > >=20
> > > You can add one to the front, you can also use something like the=
elksemu
> > > 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 exampl=
e to
> > follow.=20
> >=20
> > NB: Why does trying to exec a script with an interpreter that is it=
self a
> > script cause an error? Specifically, EPERM? I think that should be =
allowed.
> > (Yes I know, other Unixes frequently don't allow this, but that's n=
o
> > 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
> > %
>=20
> Maybe because of
> /tmp/bar:
> #!/tmp/bar
>=20
> (loop in the kernel)
>=20
> >=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=FCrn=
berg=20
> > Schleiermacherstra=DFe 12 \ Linux+Internet / EMail: urlichs=
@noris.de
> > 90491 N=FCrnberg (Germany) \ Consulting+Programming+Networking+e=
tc'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
>=20
Hmm I just tried this experiment out of curiosity and it worked=20
perfectly fine for me... However, I know that if a script doesnt have=20
read permission set, it can't execute, so that may have been the=20
problem...
-omnilord@igc.net
http://www.igc.net/~omnilord/