zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: One more pipeline glitch
Date: Wed, 9 Nov 2022 22:18:18 -0800	[thread overview]
Message-ID: <CAH+w=7Yw5bOr1LE8fFaEz+gA0C8arhw5tMrtbV4KdauF9bs6MQ@mail.gmail.com> (raw)

There had to be, right?

Consider:

{ sleep 5; sleep 6 } | { sleep 12; print $? }

If this is ^Z'd, "sleep 12" goes into the background and a new shell
is spawned (and immediately stopped) to handle "print $?".

Upon fg (after workers/50922), "sleep 12" is resumed and the subshell
remains stopped.  When the sleep finishes, the subshell is
foregrounded ...

... and prints 148 (SIGCONT).  This is, I guess, OK, but it means that
if we instead write

{ sleep 12 && print $? }

then print is not executed because the status of sleep appears to be nonzero.

What should we do here?


                 reply	other threads:[~2022-11-10  6:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=7Yw5bOr1LE8fFaEz+gA0C8arhw5tMrtbV4KdauF9bs6MQ@mail.gmail.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).