From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12478 invoked from network); 23 Apr 2021 12:19:35 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Apr 2021 12:19:35 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1619180375; b=xMJyOO8mpZoUyuAzVlSMgeW5ZTZDOhIn0gTmOURqA/1HX5uQe5/QplAiVP5GsLEDk8HF+FLenI T8/2wSLU7yl8/CNuaPGU8NhtPSiJB5fL07yGs+nLHjDON3iVfm4BCiJRcpmZJdxQcG64kvP7AE 4j896kc2kBTjJHMbDUsg7iu+9JWtW+Pg3CNLFNqBs4nph+A/rS5XkCgwyGAuVEHnxayMEt/wWz xiqrgc4Uek/mz1eZpNj9NwU+2dczydHpvpZ61mlRLCgq+/ahmuNSuIpG4KLptDQn5s5obEyLRQ rqHI14GrGN0x9V3T9oCqr11h2Fkaoc9WS7mN5XYDC6dPIw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (gmmr2.centrum.cz) smtp.remote-ip=46.255.227.252; dkim=pass header.d=volny.cz header.s=mail header.a=rsa-sha256; dmarc=pass header.from=volny.cz; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1619180375; bh=+8lComG78tVpCv0bOd7Yry9Op1Kj806PGXdYnAR2lZ8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Message-ID: MIME-Version:In-Reply-To:References:Cc:From:Date:Subject:To:DKIM-Signature: DKIM-Signature; b=iZZi5UCOuC2PfO0eAMcxUV2xZecrTDuiVcI2CUz+djx/QPGN3uBU5odmZTnGBHJNtlKj1MLNOv uaGVp7z/FWvnrQMa15xpKhoyQw5Q0C7fV5oaKBMdpsX5QJYkMIqVEHIwGokEgAW/Y7Y6FbO4LM VqYJ28mEFY+ltg88Gw0i+GEL9kYN2tFsB+NkCMn4E+unuTT3+YV+/Z8uinplAwyWHkdjB2EDOY Peke/rFks7hHJa9m4AiImXAfmPCnMMgeWEp6fKHKT18suzc+zgKMu70XA3CuDebH9Qw6WUgPWM Hw5u6xsjtQj+O6Scl1ar2G9wClWmmXq1GQr9L3B5YZ1mFw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Message-Id:MIME-Version:In-Reply-To:References:Cc:From:Date: Subject:To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=+ErSau+4o0GNpLJSlD9aySwzgdbNv4a8A4xkchOifE4=; b=CEgnYvvUSVmz5qm8BbT0LUcTXl 720UU6eK2JIidRhS8gaUM0ajcGQPVrlJ46dhabnGeded8bx8/RdDhHcpmOEDSnVRJ6amkM3AV7wjg Aw6Em/n/azT2K7UHSVwCWp2Ys0i+Pi1WWeK7ld2+ODY61tuM42TLOc7K/hWbOfwYDM+vL6P/N9KNZ tNOdiwkstqo0blH5UivTwXMriBOgsy9Mi8579dwnDeGSnU4A7jggk5Q/+gEM8CR8lGe1g8CLxugvb w9GZJMa5jaJekUxMMSyDeGuBfSnmTZZ/t7y4E1AefiV+AMtzCWUxfUpImP3DOCc2sdShUdaF1V/99 OoNM86GA==; Received: from authenticated user by zero.zsh.org with local id 1lZumO-000FAk-Rf; Fri, 23 Apr 2021 12:19:28 +0000 Authentication-Results: zsh.org; iprev=pass (gmmr2.centrum.cz) smtp.remote-ip=46.255.227.252; dkim=pass header.d=volny.cz header.s=mail header.a=rsa-sha256; dmarc=pass header.from=volny.cz; arc=none Received: from gmmr2.centrum.cz ([46.255.227.252]:52166) by zero.zsh.org with esmtps (TLS1:DHE-RSA-AES256-SHA:256) id 1lZuli-000Dgz-2r; Fri, 23 Apr 2021 12:18:47 +0000 Received: from gmmr-4.centrum.cz (unknown [10.255.254.25]) by gmmr2.centrum.cz (Postfix) with ESMTP id 7C75F60029F0; Fri, 23 Apr 2021 14:18:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=volny.cz; s=mail; t=1619180324; bh=+ErSau+4o0GNpLJSlD9aySwzgdbNv4a8A4xkchOifE4=; h=To:Subject:Date:From:Cc:References:In-Reply-To:From; b=JR+KVzp4Fomgzwy88vNx+CXwPM3Hk9H+Fy9n2EzMI3ZrrT1iwjyRlamBrBFCf6TdV Kovpqv64HoSNgyZhGgGo7RuMXny2guqJhCfAGE9VE/xRPI9CNnUe5yTRVbjJoAPR3L n0VrrehaZhkBvZDUkFom1Bq7J5ts69xTqO9GIyXY= Received: from vm1.excello.cz (vm1.excello.cz [IPv6:2001:67c:1591::3]) by gmmr-4.centrum.cz (Postfix) with QMQP id 78D3910000925; Fri, 23 Apr 2021 14:18:44 +0200 (CEST) Received: from vm1.excello.cz by vm1.excello.cz (VF-Scanner: Clear:RC:0(2a00:da80:1:502::7):SC:0(-4.0/5.0):CC:0:; processed in 0.1 s); 23 Apr 2021 12:18:44 +0000 X-VF-Scanner-ID: 20210423121844.361782.27469.vm1.excello.cz.0 Received: from gmmr-2.centrum.cz (2a00:da80:1:502::7) by out2.virusfree.cz with ESMTPS (TLSv1.3, TLS_AES_256_GCM_SHA384); 23 Apr 2021 14:18:44 +0200 Received: from mail1008.cent (unknown [10.255.254.22]) by gmmr-2.centrum.cz (Postfix) with ESMTP id 449D520055F6C; Fri, 23 Apr 2021 14:18:44 +0200 (CEST) Received: by mail1008.cent (Postfix, from userid 33) id 3C9006010E2CE; Fri, 23 Apr 2021 14:18:44 +0200 (CEST) To: Subject: =?utf-8?q?revised_patch=3A_zshmisc=281=29_clarify_non=2Dsuccessful_exit_statuses?= Received: from 46.135.89.215 by mail1008.centrum.cz (centrum.cz multimail) with HTTP Date: Fri, 23 Apr 2021 14:18:44 +0200 From: Cc: Daniel Shahaf References: <20210411141520.4ABA89D5@volny.cz>, <20210413155236.GR6819@tarpaulin.shahaf.local2>, <20210413200341.D91B3837@volny.cz>, <20210414110355.GA31655@tarpaulin.shahaf.local2> <20210414134033.1AB3540B@volny.cz> In-Reply-To: <20210414134033.1AB3540B@volny.cz> X-Mailer: Centrum Email 5.3 X-Priority: 3 X-Original-From: MIME-Version: 1.0 Message-Id: <20210423141844.D01FC4C9@volny.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Seq: 48665 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: #?patch # # This revised patch adds, to the zshmisc(1) manual page, clarity about # the exit status on exec failure. # # Due to a comment on the original patches, made on the zsh-workers # mailing list: me didn't include a patch to zshmisc.1 this time. # # As me still doesn't use yodl: the immediately above does mean that # me hasn't seen how it actually looks after typesetting. # # The copied use of startsitem() was suggested on the same mailing list. # Me hopes me did it right. # # Note that the "operating system-dependent" part is made more # complicated by zsh' habit of de-capitalizing the initial character of # the string returned by strerror(3). # # Hope this is more useful (it is to me), # # --zeurkous, Fri Apr 23 12:09:47 UTC 2021. # --- Doc/Zsh/..v/5.8/exec.yo Mon Dec 4 14:09:35 2017 +++ Doc/Zsh/exec.yo Fri Apr 23 12:02:30 2021 @@ -14,10 +14,22 @@ vindex(path, use of) Otherwise, the shell searches each element of tt($path) for a -directory containing an executable file by that name. If the -search is unsuccessful, the shell prints an error message and returns -a nonzero exit status. +directory containing an executable file by that name. +If execution fails: an error message is printed, and one of the +following values is returned. + +startsitem() +sitem(127) +The search was unsuccessful. The error message is +`tt(command not found:) var(cmd)'. +sitem(126) +The executable file has insufficient permissions, or is a directory or +other type of special file, or is not a script (see below) and in a +format unrecognized by the operating system. The exact conditions and +error message are operating system-dependent; see manref(execve)(2). +endsitem() + If execution fails because the file is not in executable format, and the file is not a directory, it is assumed to be a shell script. tt(/bin/sh) is spawned to execute it. If the program @@ -29,10 +41,6 @@ If no external command is found but a function tt(command_not_found_handler) exists the shell executes this function with all command line arguments. The return status of the function becomes the -status of the command. If the function wishes to mimic the -behaviour of the shell when the command is not found, it should -print the message `tt(command not found:) var(cmd)' to standard error -and return status 127. Note that the handler is executed in a +status of the command. Note that the handler is executed in a subshell forked to execute an external command, hence changes to directories, shell parameters, etc. have no effect on the main shell. -