zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: No pipefail option?
Date: Mon, 07 Oct 2013 10:25:29 +0100	[thread overview]
Message-ID: <20131007102529.5354f342@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <131006173621.ZM31831@torch.brasslantern.com>

On Sun, 06 Oct 2013 17:36:21 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> [>workers]
> 
> On Oct 5, 10:31pm, Peter Stephenson wrote:
> }
> } Indeed, if $pipestatus is working as advertised, it really ought to be
> } this simple...
> 
> Unfortunately, $pipestatus is not working as advertised.

Looks that this might not be fatal for the most typical uses of
PIPEFAIL, since I suspect if you've got a loop at the end of the pipe
processing the results in the main shell you'd typically detect errors
at that point.

> See this thread from 2011:
> 
> http://www.zsh.org/mla/workers/2011/msg01394.html
> 
> In particular
> 
> http://www.zsh.org/mla/workers/2011/msg01396.html
> http://www.zsh.org/mla/workers/2011/msg01470.html
> http://www.zsh.org/mla/workers/2011/msg01475.html
> http://www.zsh.org/mla/workers/2011/msg01476.html
> 
> The patch mentined in msg01476 is here:
> 
> http://www.zsh.org/mla/workers//2011/msg01472.html
> 
> But it didn't resolve the issue, so I never committed it.
> 
> The long and short of it is that pipestatus only works reliably when
> all the commands in the pipeline are external programs.

It's not clear to me if (i) the problem is only relevant to the final
stage in the pipeline (as we fork for others anyway) (ii) you need a
complex command rather than a simple builtin to get confused, but
presumably a complex command might be a function as there's nothing
special about jobs run from inside a function (they are not encapsulated
as far as job control is concerned).

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.

pws


  reply	other threads:[~2013-10-07  9:25 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 [this message]
2013-10-07 14:40       ` Bart Schaefer
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=20131007102529.5354f342@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.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).