Date: Sun, 1 Oct 1995 13:16:48 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: taob@io.org (Brian Tao) Cc: kaleb@x.org, hackers@freefall.freebsd.org Subject: Re: /bin/sh thinks it's csh Message-ID: <199510012016.NAA20297@phaeton.artisoft.com> In-Reply-To: <Pine.BSI.3.91.951001160611.19034V-100000@trepan.io.org> from "Brian Tao" at Oct 1, 95 04:07:17 pm
next in thread | previous in thread | raw e-mail | index | archive | help
>
> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510012016.NAA20297>
