Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
One more pipeline glitch
- X-seq: zsh-workers 50930
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: One more pipeline glitch
- Date: Wed, 9 Nov 2022 22:18:18 -0800
- Archived-at: <https://zsh.org/workers/50930>
- List-id: <zsh-workers.zsh.org>
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?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author