Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to generate a list of numbers without 'seq'?
- X-seq: zsh-users 7202
- From: DervishD <raul@xxxxxxxxxxxx>
- To: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>
- Subject: Re: How to generate a list of numbers without 'seq'?
- Date: Sat, 20 Mar 2004 11:00:00 +0100
- Cc: Clint Adams <clint@xxxxxxx>, Zsh Users <zsh-users@xxxxxxxxxx>
- In-reply-to: <20040319163425.GF99558@xxxxxxxxxxxxxxxx>
- Mail-followup-to: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>, Clint Adams <clint@xxxxxxx>, Zsh Users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Pleyades
- References: <20040318205201.GA1228@DervishD> <20040318211223.GA1543@xxxxxxxxxxx> <20040319095840.GD1228@DervishD> <20040319163425.GF99558@xxxxxxxxxxxxxxxx>
Hi Dan :)
* Dan Nelson <dnelson@xxxxxxxxxxxxxxx> dixit:
> > > print -l {0..10}
> > This is more similar to the solution I was trying using <X-Y>,
> > which doesn't seem to work if it cannot be expanded :( But IIRC, I've
> > used <X-Y> syntax to generate list of numbers, but I don't remember
> > how, when, etc.
> <x-y> is pattern matching, so it only matches existing filenames;
Is there a way of making it work in string environment or
something like that (a mechanism similar to the use of globbing flags
in pattern matching at parameter expansion)?
> {x..y} is parameter expansion so it generates its own values. If
> you have a LOT of numbers you want to generate, {x..y} will suck up
> memory, so incrementing and printing a counter variable in a loop
> is better.
So for general use, when you don't know in advance how many
numbers you want to generate, is better to use the variable in a
loop.
Thanks for the information :))
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author