From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28911 invoked from network); 26 Nov 2002 11:10:23 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Nov 2002 11:10:23 -0000 Received: (qmail 14001 invoked by alias); 26 Nov 2002 11:09:55 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5521 Received: (qmail 13929 invoked from network); 26 Nov 2002 11:09:48 -0000 To: zsh-users@sunsite.dk Cc: dominik.vogt@gmx.de Subject: Re: why does "jobs | wc" not work? In-reply-to: "Dominik Vogt"'s message of "Tue, 26 Nov 2002 11:49:30 +0100." <20021126104930.GE1937@gmx.de> Date: Tue, 26 Nov 2002 11:09:15 +0000 Message-ID: <18744.1038308955@csr.com> From: Peter Stephenson Dominik Vogt wrote: > There seems to be a strange bug with the jobs command in > zsh-4.0.4. It seems that the output of the jobs command refuses > to go into a pipe. This isn't strictly a bug, but there's a workaround in the 4.1 code. In zsh jobs | anything causes the shell to fork for the left hand side of the pipeline. This is then no longer the shell with the job control, hence doesn't show any jobs. Other shells fork the `anything' and run `jobs' in the current shell. We deliberately don't do that because we like to be able to do anything | read foo to get the variable $foo set in the current shell (and all sorts of similar examples). In 4.1, we use the obvious workaround: remember that we're in a subshell of an interactive shell and keep a fossilized list of the jobs. This can mean that the task list isn't up to date at the point where the jobs command is actually run --- though there are obvious races when background jobs terminate anyway, so I don't think that's a major concern. -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************