Re: degraded error message in case of hash-bang interpreter error
From:
Chet Ramey
Subject:
Re: degraded error message in case of hash-bang interpreter error
Date:
Mon, 4 Nov 2024 10:02:31 -0500
User-agent:
Mozilla Thunderbird
On 11/3/24 10:45 PM, Martin D Kealey wrote:
This is one of those cases I would file under "POSIX being annoyingly literal".
POSIX says that the execve syscall reads the name of an interpreter (and
options) from a '#!' line, prefaces them onto the front of argv, and then
restarts itself. This is why some people argue that ENOENT is "logical" the
interpreter can't be found. (And to be fair, Linux seems to apply this to /
any/ missing "interpreter", including the ELF loader.)
It doesn't. You have to deal with what the implementations return and
make your best guess.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/