Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: trapped in bash
- X-seq: zsh-users 22234
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Subject: Re: trapped in bash
- Date: Mon, 19 Dec 2016 00:32:19 +0000
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= mesmtp; bh=bx4Asr+WvJEsvVzkfqftDRkJQ1c=; b=JbsmmWbhzDAiWEr3+dnAj +co3QW2XdgE/qBQGb7x3GPos10JSzmU187iy96Zrsve3ZND433LKw6i2btALOnxa sunau+8Sa0eflmRUGofWj3xaal7L4GEMHwZNmhaiqw54WCVXzfCzWOtm7ISslheB CkFFy+vKb+47zyGBqWlYTg=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=bx4Asr+WvJEsvVzkfqftDRkJQ1c=; b=k6QxWPpQ84Ztywaodapa 3ZE9ZTQPEjJ67tIDxh6onft4Q+eCJjLb6vaFh6sIJTQXzgiCr7tXTtbVAiqjmi/M GlCQIAMCr4ZxQLC4P19ZXbQTKl4OfEcPGXRHSZOLjcwWYiTeqaZopAkr27mvXoR+ vKtPUMcJ6kpdPoi5c27FVPA=
- In-reply-to: <5856B133.9010602@eastlink.ca>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <58540944.3030706@eastlink.ca> <20161216215117.GF2023@pug.qqx.org> <58546D36.5050908@eastlink.ca> <161216150556.ZM4016@torch.brasslantern.com> <58559FC0.3080501@eastlink.ca> <161217124354.ZM7815@torch.brasslantern.com> <5855BEF2.6090208__18199.534857604$1482015164$gmane$org@eastlink.ca> <20161218150628.GB9158@fujitsu.shahaf.local2> <5856B133.9010602@eastlink.ca>
Ray Andrews wrote on Sun, Dec 18, 2016 at 07:54:27 -0800:
> Would it be doable to distinguish between *really* 'not found' and
> 'can't run this binary'? If nothing else it would have stopped me
> from having to ask that question :-/
As far as zsh is concerned, a binary file is simply something that can
be passed to execve(). zsh does not attempt to parse or load the file;
the C library and OS do. So it is they who are in a position to issue
an error message explaining _why_ the file can't be executed.
I suppose you could write a command_not_found_handler() function that
tried to reverse engineer _why_ the command wasn't found — with the
obvious limitations, e.g., race conditions between the library's
execution and the handler's.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author