From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 604 invoked from network); 29 Jun 2001 09:11:30 -0000 Received: from ns2.primenet.com.au (HELO mail2.primenet.com.au) (?pvZ3gCT/WdgB3BnOY8QgYkZI0oy1sMIZ?@203.24.36.3) by ns1.primenet.com.au with SMTP; 29 Jun 2001 09:11:30 -0000 Received: (qmail 8261 invoked from network); 29 Jun 2001 09:04:46 -0000 Received: from sunsite.dk (130.225.51.30) by ns2.primenet.com.au with SMTP; 29 Jun 2001 09:04:46 -0000 Received: (qmail 28118 invoked by alias); 29 Jun 2001 09:03:35 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3979 Received: (qmail 28107 invoked from network); 29 Jun 2001 09:03:34 -0000 MIME-Version: 1.0 From: Vincent Lefevre To: zsh-users@sunsite.dk Date: Fri, 29 Jun 2001 11:04:06 +0200 Subject: Re: Functions that start Jobs Message-ID: <4a92242e9dvincent@vinc17.org> In-Reply-To: <200106290826.KAA04489@beta.informatik.hu-berlin.de> References: <20010629010412.A1776@yahoo.com> <200106290826.KAA04489@beta.informatik.hu-berlin.de> User-Agent: Pluto/2.02e (RISC-OS/4.02) POPstar/2.03 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit On 29 Jun, Sven Wischnowsky wrote: > Because no other shell can do this: > % f() { sleep 10; echo foo } > % f > ^Z > zsh: 4022 suspended f > % fg > [1] + continued f > [ time passes... ] > foo I have 2 questions: 1) Is the function executed in the current shell? I don't understand what happens exactly. What happens if Ctrl-Z is typed while a builtin is being executed? 2) I tried this example (with 100 instead of 10, to have more time), and after I typed fg, the sleep ends immediately (i.e., no time passes). I have the same behaviour on two machines under Linux (Linux/x86 and Linux/ppc). Is this normal? -- Vincent Lefèvre - Web: - 100% validated 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