From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15071 invoked by alias); 19 Dec 2016 00:35:22 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22234 Received: (qmail 4638 invoked from network); 19 Dec 2016 00:35:22 -0000 X-Qmail-Scanner-Diagnostics: from out1-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.25):SA:0(-0.7/5.0):. Processed in 1.195921 secs); 19 Dec 2016 00:35:22 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) 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= X-ME-Sender: X-Sasl-enc: N/Gkmwb0fWHZA/m9QhjXPtcFy9qAUs2EHI44WEovzz1N 1482107713 Date: Mon, 19 Dec 2016 00:32:19 +0000 From: Daniel Shahaf To: Ray Andrews Cc: zsh-users@zsh.org Subject: Re: trapped in bash Message-ID: <20161219003219.GA21509@fujitsu.shahaf.local2> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5856B133.9010602@eastlink.ca> User-Agent: Mutt/1.5.23 (2014-03-12) 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