On 13/04/2021 14:43, Chet Ramey wrote:
On 4/13/21 5:16 AM, Harald van Dijk via austin-group-l at The Open Group
wrote:
Please note again that POSIX's Command Search and Execution doesn't
say "continue until execve() doesn't fail". It says "Otherwise, the
command shall be searched for using the PATH environment variable as
described in XBD Environment Variables", and then what happens to the
result of that search. It very clearly separates the search from the
attempt to execute.
The complicating factor is POSIX's definition of "executable file."
You search "until an executable file with the specified name and
appropriate execution permissions is found."
An executable file is a "regular file acceptable as a new process image
file by the equivalent of the exec family of functions."
Good spot. We know that it is intended for command search and execution
to also find shell scripts that are then interpreted by the shell, shell
scripts that execve() cannot process, and all shells implement this as
intended rather than as specified. This must be a defect in the current
wording.
Cheers,
Harald van Dijk