zsh-workers
 help / color / mirror / code / Atom feed
* How to misplace an entire pipeline
@ 2011-08-06  3:31 Bart Schaefer
  2011-08-07 17:50 ` Peter Stephenson
  0 siblings, 1 reply; 16+ messages in thread
From: Bart Schaefer @ 2011-08-06  3:31 UTC (permalink / raw)
  To: zsh-workers

Suspend a pipeline whose tail is a builtin that has already exited, and
the whole job gets lost, orphaning the left hand side:

torch% print $ZSH_VERSION $ZSH_PATCHLEVEL
4.3.12-dev-1 1.5412
torch% sleep 10 | true
torch% jobs
torch% ps ax | grep sleep
32474 pts/2    T      0:00 sleep 10
32480 pts/2    S+     0:00 grep sleep
torch% 

Worse, suspend a pipeline whose tail is a builtin that blocks on I/O:

torch% sleep 10 | sleep 20 | read

The builtin does not get suspended, so the shell is stuck; fortunately in
this case one can interrupt the builtin, again leaving the left side in
limbo:

torch% ps ax | grep sleep
32493 pts/2    T      0:00 sleep 10
32494 pts/2    T      0:00 sleep 20
32501 pts/2    S+     0:00 grep sleep

This used to work, sort of:

torch% print $ZSH_VERSION $ZSH_PATCHLEVEL
4.2.0
torch% sleep 10 | sleep 20 | true

zsh: suspended  sleep 10 | sleep 20
torch% jobs
[1]  + suspended  sleep 10 | sleep 20
torch% 

Note that the builtin is gone but the rest of the pipeline remains a job.

-- 


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-09-16 16:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-06  3:31 How to misplace an entire pipeline Bart Schaefer
2011-08-07 17:50 ` Peter Stephenson
2011-08-07 21:43   ` Bart Schaefer
2011-08-08  4:05     ` Bart Schaefer
2011-08-08 18:27       ` Peter Stephenson
2011-08-09  6:10         ` Bart Schaefer
2011-08-09 20:19           ` Peter Stephenson
2011-08-13 18:52             ` Bart Schaefer
2011-08-13 20:15               ` Bart Schaefer
2011-09-12 13:51               ` Alexey I. Froloff
2011-09-12 16:03                 ` Bart Schaefer
2011-09-12 16:18                   ` Bart Schaefer
2011-09-12 16:35                     ` Peter Stephenson
2011-09-15 14:57                       ` Alexey I. Froloff
2011-09-16 16:16                         ` Bart Schaefer
2011-09-12 16:27                   ` Alexey I. Froloff

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