From owner-freebsd-hackers Sun Oct 1 13:22:35 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA27160 for hackers-outgoing; Sun, 1 Oct 1995 13:22:35 -0700 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id NAA27155 for ; Sun, 1 Oct 1995 13:22:32 -0700 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA20297; Sun, 1 Oct 1995 13:16:48 -0700 From: Terry Lambert Message-Id: <199510012016.NAA20297@phaeton.artisoft.com> Subject: Re: /bin/sh thinks it's csh To: taob@io.org (Brian Tao) Date: Sun, 1 Oct 1995 13:16:48 -0700 (MST) Cc: kaleb@x.org, hackers@freefall.freebsd.org In-Reply-To: from "Brian Tao" at Oct 1, 95 04:07:17 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1483 Sender: owner-hackers@FreeBSD.org Precedence: bulk > > On Fri, 29 Sep 1995, Kaleb S. KEITHLEY wrote: > > > > % sh -c 'echo $1' foo bar baz > > foo > > % csh -c 'echo $1' foo bar baz > > foo > > > > POSIX.2 Section 4.56.3 says everyone else is right, and FreeBSD is ... > > not right. > > 950726 has this beahviour too, which I always thought was correct. > Why would $1 represent anything other than the first argument in argv? man exec: The exec family of functions replaces the current process image with a new process image. The functions described in this manual page are front-ends for the function execve(2). (See the manual page for execve for detailed information about the replacement of the current process.) The initial argument for these functions is the pathname of a file which is to be executed. The const char *arg and subsequent ellipses in the execl(), execlp(), and execle() functions can be thought of as arg0, arg1, ..., argn. Together ^^^^ they describe a list of one or more pointers to null-terminated strings that represent the argument list available to the executed program. The first argument, by convention, should point to the file name associated with the file being executed. The list of arguments must be terminated by a NULL pointer. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.