Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

One more pipeline glitch



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