Subject: Re: Changing exec's #! behavior
To: None <tech-kern@netbsd.org>
From: James R Grinter <jrg@blodwen.demon.co.uk>
List: tech-kern
Date: 06/18/2000 13:51:08
Andrew Brown <atatat@atatdot.net> writes:
> but, no, it doesn't specify how the arg is supposed to be delimited,
> nor does it mention any of the limits (interpreter and arg are limited
> to max 32 characters each) i thought there were.  i wonder where i got
> those silly ideas...

from SunOS4, execve:

     An interpreter file begins with  a  line  of  the  form  `#!
     interpreter [arg]'.  Only the first thirty-two characters of
     this line are significant.  When path refers  to  an  inter-
     preter file, execve() invokes the specified interpreter.  If
     the optional arg is specified, it becomes the first argument
     to  the  interpreter,  and the pathname to which path points
     becomes the second argument.   Otherwise,  the  pathname  to
     which  path  points becomes the first argument. The original
     arguments are shifted over to become  the  subsequent  argu-
     ments.   The zeroth argument, normally the pathname to which
     path points, is left unchanged.

'first thirty-two characters of this line'
'optional argument' (not plural)

James.