Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: getting the status of the left-hand side of a pipe in the right-hand side
- X-seq: zsh-users 24121
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- 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
- 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==
- In-reply-to: <20190801154346.GA18570@zira.vinc17.org>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20190801154346.GA18570@zira.vinc17.org>
On Thu, Aug 1, 2019, 8:44 AM Vincent Lefevre <vincent@xxxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author