On 10/11/21 7:09 AM, Robert Elz wrote: > Date: Sun, 10 Oct 2021 21:09:53 -0400 > From: Eli Schwartz <eschwa...@archlinux.org> > Message-ID: <4a362385-066d-0795-9a02-ff8bbb920...@archlinux.org> > > | So I wonder, if bash already in this exact case attempts to open() the > | file and read() it to look for a shebang, what's the harm in assuming > | (or checking) that it exists in this patch? > > This is clearly an OS problem, not one in bash.
This is true. And yet: > POSIX says of ENOENT as it applies to the exec*() set of functions: > > [ENOENT] A component of path or file does not name an existing file > or path or file is an empty string. When execve returns this error for what is a clearly invalid reason, it's not unreasonable that the shell help. It's a quality of implementation issue at that point. If execve ever returns a different error for this situation, the 5 lines of code will no longer be needed. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/