Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: counting in "for" loops



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)

% ( 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*
-- 
--> Phil Pennock ; GAT d- s+:+ a22 C++(++++) UL++++/I+++/S+++/H+ P++@ L+++
E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++ DI+ D+
G+ e+ h* r y?



Messages sorted by: Reverse Date, Date, Thread, Author