From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1906 invoked by alias); 6 Aug 2011 03:31:37 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29649 Received: (qmail 19493 invoked from network); 6 Aug 2011 03:31:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110805203111.ZM32508@torch.brasslantern.com> Date: Fri, 05 Aug 2011 20:31:09 -0700 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: How to misplace an entire pipeline MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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. --