From owner-freebsd-questions Tue Oct 5 2:54: 8 1999 Delivered-To: freebsd-questions@freebsd.org Received: from internal.mail.demon.net (internal.mail.demon.net [193.195.224.3]) by hub.freebsd.org (Postfix) with ESMTP id 5C14B14CF8 for ; Tue, 5 Oct 1999 02:53:57 -0700 (PDT) (envelope-from fanf@demon.net) Received: from fanf.eng.demon.net (fanf.eng.demon.net [195.11.55.89]) by internal.mail.demon.net with ESMTP id KAA13340; Tue, 5 Oct 1999 10:53:51 +0100 (BST) Received: from fanf by fanf.eng.demon.net with local (Exim 3.03 #2) id 11YRHd-000ItM-00 for freebsd-questions@freebsd.org; Tue, 05 Oct 1999 10:53:21 +0100 From: Tony Finch To: freebsd-questions@freebsd.org Subject: execve and #! arguments Message-Id: Date: Tue, 05 Oct 1999 10:53:21 +0100 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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