From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 2365ed8b for ; Thu, 1 Aug 2019 22:45:13 +0000 (UTC) Received: (qmail 4834 invoked by alias); 1 Aug 2019 22:44:58 -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: List-Unsubscribe: X-Seq: 24122 Received: (qmail 6785 invoked by uid 1010); 1 Aug 2019 22:44:58 -0000 X-Qmail-Scanner-Diagnostics: from joooj.vinc17.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25524. spamassassin: 3.4.2. Clear:RC:0(155.133.131.76):SA:0(-1.9/5.0):. Processed in 3.547018 secs); 01 Aug 2019 22:44:58 -0000 X-Envelope-From: vincent@vinc17.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at vinc17.net does not designate permitted sender hosts) Date: Fri, 2 Aug 2019 00:44:17 +0200 From: Vincent Lefevre To: zsh-users@zsh.org Subject: Re: getting the status of the left-hand side of a pipe in the right-hand side Message-ID: <20190801224417.GA1259@zira.vinc17.org> Mail-Followup-To: zsh-users@zsh.org References: <20190801154346.GA18570@zira.vinc17.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.12.1+33 (6a74e24e) vl-117499 (2019-06-23) On 2019-08-01 09:49:03 -0700, Bart Schaefer wrote: > So you might be able to find the job from the job table but the best you > can reliably do for its status is to send it a "kill -0" and see if that > returns error. Can I assume that the left-hand side is the last job in the table (this seems to be the case in all the tests I've done)? That would be nice as a precise status is provided: either "running" or the exit status. And this would be very useful as it appears that $pipestatus no longer contains the expected value if the jobs builtin is used: zira% false | { sleep 1; jobs } ; echo $pipestatus [1] exit 1 false 0 i.e. "0" instead of "1 0". Is this a bug? At least, this is not documented. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)