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=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 91d343ee for ; Thu, 1 Aug 2019 16:50:02 +0000 (UTC) Received: (qmail 18437 invoked by alias); 1 Aug 2019 16:49:54 -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: 24121 Received: (qmail 20818 invoked by uid 1010); 1 Aug 2019 16:49:54 -0000 X-Qmail-Scanner-Diagnostics: from mail-lj1-f175.google.com 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(209.85.208.175):SA:0(-1.9/5.0):. Processed in 3.771909 secs); 01 Aug 2019 16:49:54 -0000 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.208.175 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=qO3q/OM8o7+JEMwc2z7hUqvCTg1sE7n9amr6oZH/vK4=; b=jMGNX2PjvPUwZ/pSVU9YJ3bJqw9aWQ1/WkqNHKMdSjTpAbEQx6yH4p7QicpqOWu0d4 YZo6r4aemUpCBUiU4fgLBwTMwx85Kc4WIMHHCosdlMPVP+HkdPbRsfbI7msmc/cre+tH o+OjTrD1fwecLkPG9xVgdSI9jld/P6pWI5NNvFk1XM5uVwOJVUYUuZWCX89A3jTZF3ed FPyv9KJNztUPY9FdhOwEN5RCEH4F91KKFS2TnFB8b2o9yr1wAqhwxnqoMMtsLOxZfHem 1n9SQD7ipa6GndCU3bzk2ZinVylkLMF1f8Wj2beUG/tr4xm1kWNQh8Cr+Yup7eyS/yKB an4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=qO3q/OM8o7+JEMwc2z7hUqvCTg1sE7n9amr6oZH/vK4=; b=nirgof9SnHnOsPmkxjFrawj3b2Bgu3PgDEiV5C1AbFXhzH78y6Bm89Euw39RcJOhIy MP4MVQmxpX4/5tRBUp8ye8PTgdwyw/0Xb2l956hLhTddEibiPES2+/X5+C+2fAGpDHYO NPFHowu9AthWX+R4cPivDm/wHLveMu183m3biPNjoe29EQuCBcfEoPnvRNrNTRFZP3Me GArraPQrKkZObiYkKj4vduj2z+xkZAUMY1trbPNDIwnc8WTAhyXsmGoLEMhQlGEAx3cX U/JKBW+PUE5PIo138lmpXaDpy1l9XfYMvUPdEcyWKDSnHOu0SPGXh4VyTMTDMwqNZ9JQ vSNw== X-Gm-Message-State: APjAAAUl5yg1xwgaTehQj9hreCifi28MbSAIF2mFDaTutlRoz27WF4wq rnZKWmUNrnWFFhUVgocEbeN9DJwaGzzEgKa7JSr52w== X-Google-Smtp-Source: APXvYqxpmDqASMifXEsvxa5tZ9oyF//LxnlxWx48vQ0MTBE1IZG6/lUBVNb25PkHXlp1QETTOa/tqjJzuF3Qf8uW3rs= X-Received: by 2002:a2e:86cc:: with SMTP id n12mr43744385ljj.146.1564678154939; Thu, 01 Aug 2019 09:49:14 -0700 (PDT) MIME-Version: 1.0 References: <20190801154346.GA18570@zira.vinc17.org> In-Reply-To: <20190801154346.GA18570@zira.vinc17.org> From: Bart Schaefer Date: Thu, 1 Aug 2019 09:49:03 -0700 Message-ID: Subject: Re: getting the status of the left-hand side of a pipe in the right-hand side To: Zsh Users Content-Type: multipart/alternative; boundary="0000000000009cfdef058f11059e" --0000000000009cfdef058f11059e Content-Type: text/plain; charset="UTF-8" On Thu, Aug 1, 2019, 8:44 AM Vincent Lefevre wrote: > I would like to get the status of the left-hand side of a pipe > in the right-hand size. Knowing whether it has terminated or not > should be sufficient. > > Information is probably known from the job table > This is not the case in general. The job status is only communicated by the OS to the direct parent of the job, and the job table typically becomes static in any subshell (it used to be completely erased in subshells but people wanted to examine output of "jobs" for prompts etc.). 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. --0000000000009cfdef058f11059e--