Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Array indirection
- X-seq: zsh-users 10778
- From: Wojciech Pietron <W.Pietron@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Array indirection
- Date: Tue, 3 Oct 2006 17:54:29 +0200
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
ZSH_VERSION=4.0.2
Hello,
I need to analyze a couple of arrays and decided to take advantage of
indirection:
==================================================
#!/bin/zsh
names=(peter ann)
digits=(one two three four)
analyze=(names digits)
for t in $analyze; do
for ((i=1; i<=${(P)#t}; i++)); do
#No problems with displaying the indirect tables
echo ${(P)t}
done
done
==================================================
I have no problems with displaying the contents of the indirect table
inside of the inner loop but how can I do the following operations there:
- displaying i-th element of the array;
- setting i-th element of the array.
I would appreciate any help.
Best regards,
Wojciech Pietron
Messages sorted by:
Reverse Date,
Date,
Thread,
Author