From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24526 invoked by alias); 19 Aug 2010 14:26:03 -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: 15294 Received: (qmail 11727 invoked from network); 19 Aug 2010 14:26:01 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Thu, 19 Aug 2010 16:25:58 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: Option PRINT_EXIT_VALUE doesn't always work as expected Message-ID: <20100819142558.GA25968@prunille.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <20100730130204.GC8757@ypig.lip.ens-lyon.fr> <20100731225345.2cad292e@pws-pc> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100731225345.2cad292e@pws-pc> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.20-6127-vl-r38670 (2010-08-14) On 2010-07-31 22:53:45 +0100, Peter Stephenson wrote: > On Fri, 30 Jul 2010 15:02:04 +0200 > Vincent Lefevre wrote: > > Also, if tst is a script that does "exit 141", I get as expected: > > > > ypig% ./tst | head -n 1 > > zsh: exit 141 ./tst | > > zsh: done head -n 1 > > ypig% echo $pipestatus > > 141 0 > > > > but if tst does "kill -PIPE $$", I get: > > > > ypig% ./tst | head -n 1 > > ypig% echo $pipestatus > > 141 0 > > The fact that the signal number + 128 is added to get the status isn't > currently taken account at that point. It should presumably be > transparent. Actually I'm wondering whether this is a good idea. I often do "program | less" and I often quit "less" before looking at the end of the output, so that one gets a typical broken pipe, with a useless "zsh: broken pipe" message. Perhaps there should be an option (useful only with PRINT_EXIT_VALUE) to ignore the broken pipe specifically. And/or an option so that exit information is output only when the last command of a pipeline exits with a non-zero status. I'm also wondering whether I still need PRINT_EXIT_VALUE since I now print the exit status (or signal) in my prompt. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)