From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1227 invoked from network); 30 Dec 1996 02:00:43 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 30 Dec 1996 02:00:43 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id UAA16344; Sun, 29 Dec 1996 20:38:45 -0500 (EST) Resent-Date: Sun, 29 Dec 1996 20:38:45 -0500 (EST) From: Zoltan Hidvegi Message-Id: <199612292315.AAA01569@hzoli.ppp.cs.elte.hu> Subject: Re: bug in select To: ymmt@camille.is.s.u-tokyo.ac.jp Date: Mon, 30 Dec 1996 00:15:15 +0100 (MET) Cc: zsh-workers@math.gatech.edu In-Reply-To: <199612290328.MAA00797@verdy.is.s.u-tokyo.ac.jp> from Yamamoto Hirotaka at "Dec 29, 96 12:28:22 pm" X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"AtcV71.0.G_3.aqnno"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2664 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > Hi, > > I found a buggy feature in zsh's `select' built-in command. > here's the log. > > verdy% select i in aaa bbb ccc > do echo $i > done > 1) aaa 2) bbb 3) ccc > ?# 1 > 0 I bet that i is integer here. Look: hzoli% select i in aaa bbb ccc do echo $i done 1) aaa 2) bbb 3) ccc ?# 1 aaa 1) aaa 2) bbb 3) ccc ?# hzoli% integer i hzoli% select i in aaa bbb ccc do echo $i done 1) aaa 2) bbb 3) ccc ?# 1 0 1) aaa 2) bbb 3) ccc ?# Ksh behaves exactly the same way. This is not a bug. Add unset i before select and it'll work. Note that i becomes integer if it is initialised first in an arithmetic expression, like let i=0 or $((i=0)). Zoltan