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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22592 invoked from network); 14 Jul 2021 08:04:44 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Jul 2021 08:04:44 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1626249884; b=zL5iRK42DLuEDg3Bl5aBEO1XDUuF35XxQlxBJMMmwc6B7VOIVsgWFjOVV5QstuM5JMTjouyNiW 3Q3VfwavpQ0rjOrLtdUgTvELBGZeFLdR6inTVTBwqDvKCClRJp2/hLcV2zFEbrC+W/C/NZH109 MFmLYNGZiT+yWXQlxABD1QQeEzEtJKf0xtz9JshUa1liLMJ4shR5pv5tjAg//ABL99jeoa+d3R cF52eNKdn5lnxg37+Jv0sGGrRV6D6oQ0hoKEcsikeWyC9KC6CeBeyDKg62XY6MISx2+5togfRE GHF6g34/gbjdlUtj5iUH2OBPIiWzPH0tRZ/Q7jVhx4z+tw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1626249884; bh=F2HljR4ZmWse3zYsRmystH/ZnfrD9W2f5S+GBMYRX3c=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature; b=KtoWUj3F4HFvwis0k+5hlQN204g2nIEdIcr4UXQVGti2aIRftdvsXA6K2sCAuWKfkO151IJfsX Rf51tufnf2pJc60sJ0AFZvBvApIznXJ665EUYI6P6Vk4CsrldvsiHE8h2/xndsWg6/ImrsNpD2 Sanw2QsTX1F46mvZkRPBuzqQCmtvT3Blfq0fr6dx/wXC8KArV2eLDsv75wwIaR/ZZLl7fJN0NM sAe80/6zeSHA+pO0sOkpjn+IgkU3t05LyR9V85RH15CasLUFR4hmshHDVGLtOhbSTzCsGFeooW 4IbdQ5Mp0QoZNmpIs9OR5Hdv+j+WRsKh0DeyJM5UVzYxWg==; 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:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=t3j64pMvKgrUOAgus2ynOo2qEnqYFj3eaVOwoqeAaBg=; b=o6Mk1R65UhKjamC16s9lCYDt6p A8LJYUIHCk07J/CEzyixitmnWDDNM1PAzUhsocaEKDgPalayl0uDC/yHm9l89APrbDku5IFjVAXVm VaLGf8xYfaaH2K/XN9m4tVH9OjhU8rr+bi9CfJ0bHyR6K5tsDv/ZM/HvVRPUj6vg6Glw5xNdN42Kr yanlj7IcWgrg3fYtr6mPnshqGdRxk/tXoQtIAR+ikg9E8wLpz2pXJ8CnsXbLrvAfZmKMkaNWHBjGz WRzzcPpH77Lw5Q4cjqvS526MovOgL6MecHu5EQRiDE90RhFWFCCxsAjm5uKc/mwUuKzeF0d8hJwEr aN95A3Zg==; Received: from authenticated user by zero.zsh.org with local id 1m3Zsp-000LL5-7w; Wed, 14 Jul 2021 08:04:43 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:36442) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1m3ZsU-000L2f-Mv; Wed, 14 Jul 2021 08:04:23 +0000 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id C186D132; Wed, 14 Jul 2021 10:04:21 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id 2D265C20D0F; Wed, 14 Jul 2021 10:04:21 +0200 (CEST) Date: Wed, 14 Jul 2021 10:04:21 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Re: [BUG] zsh dies in case of EIO with echo in .zlogout / ENOTTY Message-ID: <20210714080421.GA2423666@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org References: <20210712100224.GA9599@cventin.lip.ens-lyon.fr> <1681826594.99933.1626092000365@mail2.virginmedia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1681826594.99933.1626092000365@mail2.virginmedia.com> X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.1.1+23 (a1e71e64) vl-138565 (2021-07-12) X-Seq: 49164 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: On 2021-07-12 13:13:20 +0100, Peter Stephenson wrote: > That's equivalent to this: > > % cat source.zsh > exec 2>&- > echo Exiting2 >&2 > echo Exiting > % ./zsh > % . ./source.zsh > > % > > The inability to write to stderr to report the error writing to stderr > (I think, so not the original error on the *request* to write to stderr, > the fact it couldn't report the error) is treated as a hard error and causes > the sourced script to fail at that point. > > Not sure what the right answer is. We've also been looking at complaints that > zsh doesn't take errors with echo seriously enough... I'd say that returning with a non-zero exit status is sufficient. If the user wants the script to terminate after an error, he can test the exit status or use "set -e". I don't see why the fact that echo is a builtin should be treated differently. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)