zsh-workers
 help / color / mirror / code / Atom feed
* One more pipeline glitch
@ 2022-11-10  6:18 Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2022-11-10  6:18 UTC (permalink / raw)
  To: Zsh hackers list

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?


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-10  6:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10  6:18 One more pipeline glitch Bart Schaefer

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).