Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: counting in "for" loops
- X-seq: zsh-users 1958
- From: mason@xxxxxxxxxxxxxxx (Geoff Wing)
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: counting in "for" loops
- Date: 3 Dec 1998 21:27:25 GMT
- Organization: PrimeNet Computer Consultants
- References: <slrn76c4h1.9s2.mason@xxxxxxxxxxxxxxxxxxxxx>; from "Geoff Wing" on Thu 3 Dec 1998 (4:22 +0000) <19981203212653.56779@xxxxxxxxxxxxxxxxxxxxx>
- Reply-to: mason@xxxxxxxxxxxxxxx
Phil Pennock <phil@xxxxxxxxxxxxxxxxxxxxx> typed:
:Typing away merrily, Geoff Wing produced the immortal words:
:> like and use it. It's not as if there aren't a few choices. For starters:
:Mostly just variants on a theme. With the problem that they all look to
:produce:
:12345678910 (with no newline)
Yes, my mistake. I blindly whacked -n on the echo.
:% ( local foo; set -A foo {1..10} ; print $foo )
:% ( local foo; print ${(A)foo::={1..10}} )
:Handle it, without the trailing space of another suggestion.
:I wanted:
:% print ${(A)_::={1..10}}
:which would nicely leave $_ with the values, but _ is a readonly
:variable. *sigh*
Either way, you're not left with only one option.
--
Geoff Wing <gcw@xxxxxxxxx> Mobile : 0412 162 441
Work URL: http://www.primenet.com.au/ Ego URL: http://pobox.com/~gcw/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author