Re: #! incompatible -- binfmt_script.c broken?

H. Peter Anvin (hpa@zytor.com)
4 Dec 2002 14:28:40 -0800


Followup to: <E18JgHI-0006Gx-00@chiark.greenend.org.uk>
By author: Matthew Garrett <mgarrett@chiark.greenend.org.uk>
In newsgroup: linux.dev.kernel
>
> The *only* thing you can reliably use in #! lines is an interpreter
> followed by a single argument with no trailing space. On NetBSD with
> bash as /bin/sh:
>
> mjg59@cysteine:/tmp$ cat foo.pl
> #!/bin/sh -- # -*- perl -*- -p
> mjg59@cysteine:/tmp$ ./foo.pl
> /bin/sh: -- # -*- perl -*- -p: unrecognized option
>
> File a bug against perlrun(1).
>

I personally think that it would be nice to split it by spaces (but
yes, ' " and \ need to be handled for this to work.) It allows things
like using env to spawn a binary where the location of the interpreter
is to be extracted from PATH, for example.

-hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/