Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
ksX-Mailer: MH-E 8.6; GNU Mailutils 3.2; GNU Emacs 24.5.1
- X-seq: zsh-users 22878
- From: "jdh" <dhenman@xxxxxxxxx>
- To: <zsh-users@xxxxxxx>
- Subject: ksX-Mailer: MH-E 8.6; GNU Mailutils 3.2; GNU Emacs 24.5.1
- Date: Sat, 09 Sep 2017 17:00:37 +1700
- Cc:
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:from:date:to:cc:subject; bh=twVpfWz0i/XXGIBBjEIFPtbQas4O7eCacXOOQjJLvKE=; b=c08fRUphbM7s1MyaLCmASLdDyUIK6bUtYoL3bcImUX1LaeNH7LorlUj8RJ5QdbM5sQ gyRDeBQmwuf3TGQBQ1IM2WX2HRJzktgJIqxQ3BKwra9PgPcmUzb7vxbM4RM75h7KH+UZ NKIb0XgMSwE0OKi1vGGF1aMB47AF5u1VQ9PSbDlkI8rmaUEwYQk4xrw4HK/NyMCgPaH/ jt6sov4CdruTc5ywUHkjbJPu0nte9C07xdSXOZvlPjJDbdoChF3YpIJdLvvE3kKYVc7H yeY8hThMFOyuBIdY+m3Nu8ONBviUjzC1ZM8wJ/enbyFremcmWQkUH8GFjyjtn6wE03PB yILQ==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
I wanted to use the array flage (i) to get an index into a charagcter array (a string), but am getting incorrect results. Here is an example code snippet which shows the oddity.
#
# below define a table (string) with 4 characters.
chrtab="#()*"
for (( ndx=1; ndx<=$#chrtab ; ndx++ ))
do echo "Character is $chrtab[ndx], but retrieved index is $chrtab[(i)$chrtab[ndx]]"
done
I expect the result to be 1, 2, 3, 4
but get 5, 5, 5, 1
Is this a a feature or a bug?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author