Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: bug in select
- X-seq: zsh-workers 2664
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: ymmt@xxxxxxxxxxxxxxxxxxxxxxxxxx
- Subject: Re: bug in select
- Date: Mon, 30 Dec 1996 00:15:15 +0100 (MET)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <199612290328.MAA00797@xxxxxxxxxxxxxxxxxxxxxxxx> from Yamamoto Hirotaka at "Dec 29, 96 12:28:22 pm"
> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author