From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: No pipefail option?
Date: Mon, 07 Oct 2013 07:40:49 -0700 [thread overview]
Message-ID: <131007074049.ZM32707@torch.brasslantern.com> (raw)
In-Reply-To: <20131007102529.5354f342@pwslap01u.europe.root.pri>
On Oct 7, 10:25am, Peter Stephenson wrote:
}
} I haven't yet quite worked out why it's not possible to detect the point
} at which the job is finished and examine the state at that point, so I
} can't comment further, but I might look again and ask stupid questions.
I don't remember clearly all the details, but it's some combination of:
- because external jobs can exit and be reaped in arbitrary order, even
in a pipeline, the job table is used to keep track of which position
in the array to update
- jobs that run in the current shell don't have a complete job table entry
[cf. all the gyrations to suspend/background a loop] and aren't "reaped"
in the same code path as external jobs, so the wrong array position (or
none at all) may get updated
- the incorrect update depends on whether the external job exited AND got
reaped before the current-shell job has completed, because of the way
reaping updates the job table, so correctness is unpredictable
- complex commands "in the current shell" may have external subjobs that
need a separate pipestatus (this applies only at end of a pipeline)
next prev parent reply other threads:[~2013-10-07 14:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CADv1Z=pM7H4Xg9+GyWd4zw0cv0mXfbJvqip6vc7e_yrXRN=1sg@mail.gmail.com>
[not found] ` <20131005223159.25fea6a0@pws-pc.ntlworld.com>
2013-10-07 0:36 ` Bart Schaefer
2013-10-07 9:25 ` Peter Stephenson
2013-10-07 14:40 ` Bart Schaefer [this message]
2013-10-08 20:44 ` Shell job structure Peter Stephenson
2013-10-25 5:02 ` Bart Schaefer
2013-10-25 10:00 ` Peter Stephenson
2013-10-25 15:13 ` Bart Schaefer
2013-10-25 15:21 ` Peter Stephenson
2013-10-25 17:04 ` Bart Schaefer
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=131007074049.ZM32707@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@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).