From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29925 invoked from network); 5 Oct 2004 18:19:35 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 5 Oct 2004 18:19:35 -0000 Received: (qmail 5123 invoked from network); 5 Oct 2004 18:19:29 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 5 Oct 2004 18:19:29 -0000 Received: (qmail 17668 invoked by alias); 5 Oct 2004 18:19:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20457 Received: (qmail 17649 invoked from network); 5 Oct 2004 18:19:25 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 5 Oct 2004 18:19:25 -0000 Received: (qmail 4546 invoked from network); 5 Oct 2004 18:18:26 -0000 Received: from dan.emsphone.com (199.67.51.101) by a.mx.sunsite.dk with SMTP; 5 Oct 2004 18:18:24 -0000 Received: (from dan@localhost) by dan.emsphone.com (8.12.11/8.12.11) id i95IIKAb019585; Tue, 5 Oct 2004 13:18:20 -0500 (CDT) (envelope-from dan) Date: Tue, 5 Oct 2004 13:18:20 -0500 From: Dan Nelson To: "Matthias B." Cc: zsh-workers@sunsite.dk Subject: Re: bug with for and time Message-ID: <20041005181820.GC30419@dan.emsphone.com> References: <41616CDC.8020701@codesourcery.com> <200410041610.i94GAl92005952@news01.csr.com> <20041005113848.6f3715bd@buddha.localdomain.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041005113848.6f3715bd@buddha.localdomain.de> X-OS: FreeBSD 5.3-BETA6 X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_44 autolearn=no version=2.63 X-Spam-Hits: -0.0 In the last episode (Oct 05), Matthias B. said: > On Mon, 04 Oct 2004 17:10:47 +0100 Peter Stephenson wrote: > > Nathan Sidwell wrote: > > > Zsh 4.0.4 appears to lose the time command in the following, > > > > > > nathan@garibaldi:363>for i in 1 2 ; time echo > > > > > > but, place the command in a subshell, and it works. > > > > Yes, that's always been an annoying limitation: "time" works by > > gettings system information about subprocesses, and there isn't one > > in this case. > > Then how does bash do it? bash can time builtins just fine. It probably calls getrusage(RUSAGE_SELF) before and after whatever you're timing, then prints the deltas. -- Dan Nelson dnelson@allantgroup.com