Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: lines to array
- X-seq: zsh-users 11192
- From: "Christian Walther" <cptsalek@xxxxxxxxx>
- To: "Matt Wozniski" <godlygeek@xxxxxxxxx>
- Subject: Re: lines to array
- Date: Wed, 14 Feb 2007 08:45:47 +0100
- Cc: zsh-users@xxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ZuRyDMqznD7CKuL8IbLv7oFL0BYoP8riO5gX4yFo7tT37NUigSm3dRynsRT8TjqJ4j7POUX7EgFeR8SNlydX9jjUT71JCH8dOGquCCU59RgQH0xJ/TGIMVrOqOIoiB9Oubupfk0h7tUdkeILqsPUV7CubNsMuN1I79E2q7bAqZg=
- In-reply-to: <17393e3e0702132143v36772365j179fff0f77cd6f@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20070214.050256.41196704.Meino.Cramer@xxxxxx> <17393e3e0702132143v36772365j179fff0f77cd6f@xxxxxxxxxxxxxx>
On 14/02/07, Matt Wozniski <godlygeek@xxxxxxxxx> wrote:
On 2/13/07, Meino Christian Cramer wrote:
> I am looking for a zsh-like way to put each line of the output for
> example 'ls -l' into an array.
> Is this possible without "looping" ?
>
How about this:
array=( "${(f)$(ls -l)}" )
That should work.
So this is the zsh-way... And I was wondering in the last few days how
to do this. (I finally ended up using for and changed IFS.)
Could you please explain what ${(f)...} actually does? Is there some
kind of parameter expansion going on?
~Matt
Regards
Christian (Walther)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author