From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28853 invoked from network); 26 Nov 2002 10:57:58 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Nov 2002 10:57:58 -0000 Received: (qmail 6980 invoked by alias); 26 Nov 2002 10:57:15 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5520 Received: (qmail 6954 invoked from network); 26 Nov 2002 10:57:11 -0000 MIME-Version: 1.0 From: Vincent Lefevre To: zsh-users@sunsite.dk Date: Tue, 26 Nov 2002 11:56:58 +0100 Subject: Re: why does "jobs | wc" not work? Message-ID: <4b9b6605f3vincent@vinc17.org> In-Reply-To: <20021126104930.GE1937@gmx.de> References: <20021126104930.GE1937@gmx.de> User-Agent: Pluto/2.04e (RISC-OS/4.02) POPstar/2.03 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit In article <20021126104930.GE1937@gmx.de>, 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 works: > $ sleep 1000 & > [1] 6262 > $ jobs > foo > $ wc foo > 1 5 29 foo <-- > But this does not: > $ sleep 1000 & > [1] 6262 > $ jobs | wc > 0 0 0 <-- ? > And also: > $ echo `jobs` > $ > Is there a specific reason why jobs generates no output when > running in a pipe? Because jobs is executed in a subshell? This is not the case with jobs > foo. "true | jobs" is also OK. > Note: In pdksh and bash (as bash and sh), jobs works as I would > expect; csh and tcsh work like zsh. AFAIK, shells do not implement the pipe and jobs in the same way. -- Vincent Lefèvre - Web: - 100% validated (X)HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des Jeux Mathématiques et Logiques, TETRHEX, etc. Work: CR INRIA - computer arithmetic / SPACES project at LORIA