bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No such file..?


From: Eduardo Bustamante
Subject: Re: No such file..?
Date: Fri, 5 May 2017 19:59:17 -0500

On Fri, May 5, 2017 at 7:44 PM, Peter Passchier <address@hidden> wrote:
[...]
> The output from bash is misleading. The file is there. Couldn't the
> error message be more descriptive of what's the actual problem?

Bash has no way of knowing what the problem is. Bash will do:

execve("...")

to the binary you provided. The kernel will then return "ENOENT" (from
https://linux.die.net/man/2/execve,  "ENOENT - The file filename or a
script or ELF interpreter does not exist, or a shared library needed
for file or interpreter cannot be found."). Bash sees the ENOENT
error, and prints the strerror() corresponding to that error, which is
"No such file or directory".

Bash would need an error code more specific than ENOENT from the
kernel to be able to distinguish between. ENOLIB or something.

Most likely no other shell or tool does this anyways. You can see that
strace tries to execve the tool, and it prints the same error as bash.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]