Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: lines to array
- X-seq: zsh-users 11195
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: lines to array
- Date: Wed, 14 Feb 2007 16:58:51 +0000
- In-reply-to: <20070214.175425.74743859.Meino.Cramer@xxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <17393e3e0702132143v36772365j179fff0f77cd6f@xxxxxxxxxxxxxx> <14989d6e0702132345yecd64f9xdaf474f1d3bf85ec@xxxxxxxxxxxxxx> <20070214112820.b115e849.pws@xxxxxxx> <20070214.175425.74743859.Meino.Cramer@xxxxxx>
Meino Christian Cramer wrote:
> One additional question: Is there a zshy way to sort
> the array and throw away any doubled entry ?
This is also documented:
typeset -U array
print ${(o)array}
The -U flag applies when the array is set, the (o) flag when it
is output. There's no way to specify that the array is always sorted;
you have to assign
array=(${(o)array})
--
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
To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview
Messages sorted by:
Reverse Date,
Date,
Thread,
Author