Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Keying arrays to names: is there an array of arrays?
- X-seq: zsh-users 10316
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Keying arrays to names: is there an array of arrays?
- Date: Fri, 26 May 2006 16:58:30 +0100
- In-reply-to: <200605261540.k4QFeReG007573@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <m33bewj29n.fsf@xxxxxxxxxxxxxxxxxx> <44771E3E.9070102@xxxxxxxxxxxxxxxxxx> <200605261540.k4QFeReG007573@xxxxxxxxxxxxxx>
Peter Stephenson wrote:
> % array=(one 'two three' '"four five six"')
> % typeset -A hash
> % array=(${(q)array})
> % hash[key]="${array}"
> % array=(${(Q)${(z)hash[key]}})
> % print -r $array
^^ Sorry, should be -rl for the output shown.
> one
> two three
> "four five six"
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
Messages sorted by:
Reverse Date,
Date,
Thread,
Author