From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8933 invoked from network); 5 Nov 2003 04:08:25 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 5 Nov 2003 04:08:25 -0000 Received: (qmail 21330 invoked by alias); 5 Nov 2003 04:08:18 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19222 Received: (qmail 21265 invoked from network); 5 Nov 2003 04:08:18 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 5 Nov 2003 04:08:18 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.3.58.249] by sunsite.dk (MessageWall 1.0.8) with SMTP; 5 Nov 2003 4:8:17 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id hA548FX03308 for zsh-workers@sunsite.dk; Tue, 4 Nov 2003 20:08:15 -0800 X-Authentication-Warning: candle.brasslantern.com: schaefer set sender to schaefer@closedmail.com using -f From: Bart Schaefer Message-Id: <1031105040815.ZM3307@candle.brasslantern.com> Date: Wed, 5 Nov 2003 04:08:15 +0000 In-Reply-To: <87y8uv3chb.fsf@ceramic.fifi.org> Comments: In reply to Philippe Troin "Local variable declaration in loops buglet..." (Nov 4, 4:06pm) References: <87y8uv3chb.fsf@ceramic.fifi.org> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: Local variable declaration in loops buglet... MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 4, 4:06pm, Philippe Troin wrote: } } ceramic% foo() { for i in 1 2 3; do local x; x=$i;done } } } Moving the local out of the loop fixes the echo of course... But I do } not think it should matter. This is not a bug, it's documented behavior of `typeset' for which `local' is an alias: For each remaining name that refers to a parameter that is set, the name and value of the parameter are printed in the form of an assignment. Nothing is printed for newly-created parameters, or when any attribute flags listed below are given along with the name. In 4.1.1-dev, you can `setopt typeset_silent' to suppress this.