Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: trapped in bash



On 18/12/16 09:48 PM, Bart Schaefer wrote:
On Dec 18,  8:29pm, Ray Andrews wrote:
}
} Not for me to say, but it seems to me that the simple fact that a file
} exists or does not exist is simple enough to determine

Well, yes.

The shell finds the file, because it's responsible for path search.
Exactly, I'd expect zsh to handle that with an appropriately helpful message, but past that point I quite understand that it's not the shell's affair. Mind, even subsequent error messages might be preceded by 'execve()' reports: ...' or something like that, it would just make further diagnosis a bit faster. In my situation I'd be angling for something like: "Error: binary file '/aa/bb/xxx' is not executable. execve() reports error #54321: "file not found".

It then forks, and the child process passes the full path to execve(),
which replaces the child shell with the kernel code that is supposed
to start up the new executable.

That kernel code then fails for whatever reason -- in this case, it's
because the 32-bit library is not found -- and returns a nonzero
numeric exit code to the parent shell.

The parent shell prints the message associated with that error code.
It isn't responsible for guessing what caused the error; there could
for example have been additional rounds of finding and exec'ing other
paths of which the parent has no knowledge, before a final exit.




Messages sorted by: Reverse Date, Date, Thread, Author