Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Oct 1999 10:53:21 +0100
From:      Tony Finch <fanf@demon.net>
To:        freebsd-questions@freebsd.org
Subject:   execve and #! arguments
Message-ID:  <E11YRHd-000ItM-00@fanf.eng.demon.net>

next in thread | raw e-mail | index | archive | help
The manual page says:

     An interpreter file begins with a line of the form:

           #! interpreter [arg]

     When an interpreter file is execve'd, the system actually execve's the
     specified interpreter. If the optional arg is specified, it becomes the
     first argument to the interpreter, and the name of the originally
     execve'd file becomes the second argument; otherwise, the name of the
     originally execve'd file becomes the first argument.  The original argu-
     ments are shifted over to become the subsequent arguments.  The zeroth
     argument, normally the name of the execve'd file, is left unchanged.

but FreeBSD allows more than one arg on the #! line, and as far as I
can tell has done since before version 2.0. Other systems, including
NetBSD, Linux, Solaris, Irix, 386BSD, and 4.3BSD-Reno, implement what
the manual page says -- only one argument is passed from the #! line
to the interpreter.

Why the difference?

Tony.
-- 
f.a.n.finch    dot@dotat.at    fanf@demon.net
      Apache Software Foundation Member


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E11YRHd-000ItM-00>