Shebang

cgd@broadcom.com cgd@broadcom.com
Mon Mar 8 22:37:00 GMT 2004


At Mon, 08 Mar 2004 17:33:44 -0500, prj@po.cwru.edu wrote:
> cgd@broadcom.com wrote:
> > At Mon, 8 Mar 2004 20:50:13 +0000 (UTC), prj@po.cwru.edu wrote:
> >> But you can do:
> >> #!/usr/bin/env shell-script
> >> ... input interpreted by shell-script here ...
> ...
> > To quote the solaris manual page for execve:
> ...
> >      The interpreter named by pathname must
> >      not be an interpreter file.
> 
> Right.  That's why I used /usr/bin/env - which is a binary, not a
> script - as the interpreter.  The rule prohibits using a script
> *directly* as an interpeter of another script; that's why I wedge env
> in between, to work around that rule.

yeah, quoting the manual page was a red herring.


anyway if you look at the example I pasted, your trick obviously
doesn't work on linux with /bin/sh...

I just tried solaris, too, same result.

it's not portable.

(where does it work for you?)



cgd




More information about the Gcc mailing list