From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9616 invoked from network); 5 Jan 2004 20:44:37 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Jan 2004 20:44:37 -0000 Received: (qmail 23151 invoked by alias); 5 Jan 2004 20:44:21 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6981 Received: (qmail 23077 invoked from network); 5 Jan 2004 20:44:21 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 5 Jan 2004 20:44:21 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [68.1.17.115] by sunsite.dk (MessageWall 1.0.8) with SMTP; 5 Jan 2004 20:44:20 -0000 Received: from quark.localdomain ([68.12.75.33]) by lakemtao06.cox.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040105204420.GOBQ24575.lakemtao06.cox.net@quark.localdomain> for ; Mon, 5 Jan 2004 15:44:20 -0500 Received: from quark.localdomain (localhost.localdomain [127.0.0.1]) by quark.localdomain (8.12.9/8.12.9) with ESMTP id i05KiRuO082842 for ; Mon, 5 Jan 2004 14:44:27 -0600 (CST) (envelope-from vince@quark.localdomain) Received: (from vince@localhost) by quark.localdomain (8.12.9/8.12.9/Submit) id i05KiRMZ082841 for zsh-users@sunsite.dk; Mon, 5 Jan 2004 14:44:27 -0600 (CST) Date: Mon, 5 Jan 2004 14:44:27 -0600 From: Vincent Stemen To: zsh-users@sunsite.dk Subject: Re: problem piping output of shell builtin Message-ID: <20040105204427.GA82668@quark.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i On Mon, Jan 05, 2004 at 07:26:15PM +0000, gj@sdf.lonestar.org wrote: > Hi all, > > I'm migrating from bash to zsh. It hasn't been so bad because I'm sort of new > to shell programming anyways ( though I did have "fun" figuring out that zsh > arrays start incrementing from 1 as opposed to bash's 0 :). I thought I'd > share the latest hiccup... > > Why can't I pipe the output of 'jobs' thusly? > > % zsh --version > zsh 4.0.7 (alpha--netbsd) > % sleep 100 > ^Z > zsh: suspended sleep 100 > % sleep 100 > ^Z > zsh: suspended sleep 100 > % jobs > [1] suspended pine > [2] - suspended sleep 100 > [3] + suspended sleep 100 > % jobs | while read line; do echo $line; done > % > > I expect the output of last sequence of commands to be more or less the same > to the sequence before it, as under bash. How can I approximate the bashlike > behavior I expect under zsh? > > Thanks for any insight, > Gerald. That's interesting. I get the same result as you on zsh-4.0.9 but when I tried it on zsh-4.1.0-dev-5 it works properly. $ zsh --version zsh 4.1.0-dev-5 (i386-portbld-freebsd5.0) $ sleep 100 ^Z zsh: suspended sleep 100 $ sleep 100 ^Z zsh: suspended sleep 100 $ jobs | while read line; do echo $line; done [1] - suspended sleep 100 [2] + suspended sleep 100 $ However, if I pipe the output of some other command like "ls", to the while loop, it works fine. The problem seems to only be when piping the output of jobs. Vincent -- Vincent Stemen Avoid the VeriSign/Network Solutions domain registration trap! http://www.InetAddresses.net