From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11779 invoked from network); 29 Jun 2001 08:31:17 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Jun 2001 08:31:17 -0000 Received: (qmail 18473 invoked by alias); 29 Jun 2001 08:30:20 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3978 Received: (qmail 18458 invoked from network); 29 Jun 2001 08:30:19 -0000 From: "Bart Schaefer" Message-Id: <1010629083026.ZM13892@candle.brasslantern.com> Date: Fri, 29 Jun 2001 08:30:26 +0000 In-Reply-To: <20010629010412.A1776@yahoo.com> Comments: In reply to Gregory Margo "Re: Functions that start Jobs" (Jun 29, 1:04am) References: <20010628153316.B20290@yahoo.com> <010628170738.ZM8419@candle.brasslantern.com> <20010629010412.A1776@yahoo.com> X-Mailer: Z-Mail (5.0.0 30July97) To: gmargo@yahoo.com Subject: Re: Functions that start Jobs Cc: zsh-users@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 29, 1:04am, Gregory Margo wrote: } } Why does a function take up a job slot? Because you can suspend it with ^Z, and at that point it does become a separate job that appears in the "jobs" output. E.g. zagzig% foo() { sleep 30 & sleep 10 } zagzig% foo [2] 13882 zsh: suspended foo zagzig% jobs [1] + suspended foo [2] - running sleep 30 } And if it does, why doesn't 'exec' work? If you mean what I think you mean, then the reason is that 'exec' deals with processes -- it makes a new process replace the old process. But job table entries are not processes; they're just zsh's internal method of doing record-keeping for commands in progress. Loops take up a job table slot too: zagzig% jobs zagzig% repeat 2 do sleep 5 & done [2] 13890 [3] 13891 Here "repeat ..." is job 1, so the backgrounded sleeps become 2 and 3. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net