Mail Archives: djgpp/2003/02/07/18:55:15
> I respectfully disagree with you in practical terms, in terms of
> compatibility, and in terms of the bash man page.
The functionality you reference is not handled by bash at all, so
quoting the bash man page is irrelevent. The relevent man page
is the one for execve(), which states:
DESCRIPTION
execve() executes the program pointed to by filename. filename
must be either a binary executable, or a script starting with a
line of the form "#! interpreter [arg]". In the latter case,
the interpreter must be a valid pathname for an executable
which is not itself a script, which will be invoked as
interpreter [arg] filename.
Note it says [arg] and not [args]
> if you still disagree, i would like to see the standards you
> reference - to enlighten myself.
The System V Interface Definition documents the exec*() functions
as follows:
DESCRIPTION
exec in all its forms overlays a new process image on an old
process. The new pro-cess image is constructed from an ordinary
executable file. This file is either an exe-cutable object file or a
file of data for an interpreter. There can be no return from a
successful e x e c because the calling process image is overlaid by
the new process image.
An interpreter file begins with a line of the form
#! pathname [arg]
where pathname is the path of the interpreter, and arg is an
optional argument. When you exec an interpreter file, the system
execs the specified interpreter. The pathname specified in the
interpreter file is passed as arg0 to the interpreter. If arg was
specified in the interpreter file, it is passed as arg1 to the
interpreter. The remaining arguments to the interpreter are arg0
through argn of the originally exe-cuted file.
Note that it explicitly requires that it be *one* argument.
- Raw text -