zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: getting the status of the left-hand side of a pipe in the right-hand side
Date: Thu, 1 Aug 2019 09:49:03 -0700	[thread overview]
Message-ID: <CAH+w=7apRhSvOA+v0jiJEiDv1RJeBEBA=C64U6OP2GBRw0TfJA@mail.gmail.com> (raw)
In-Reply-To: <20190801154346.GA18570@zira.vinc17.org>

[-- Attachment #1: Type: text/plain, Size: 731 bytes --]

On Thu, Aug 1, 2019, 8:44 AM Vincent Lefevre <vincent@vinc17.net> 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.

  reply	other threads:[~2019-08-01 16:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 15:43 Vincent Lefevre
2019-08-01 16:49 ` Bart Schaefer [this message]
2019-08-01 22:44   ` Vincent Lefevre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7apRhSvOA+v0jiJEiDv1RJeBEBA=C64U6OP2GBRw0TfJA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).