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 7199
- From: Dan Nelson <dnelson@xxxxxxxxxxxxxxx>
- To: Clint Adams <clint@xxxxxxx>, Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: How to generate a list of numbers without 'seq'?
- Date: Fri, 19 Mar 2004 10:34:25 -0600
- In-reply-to: <20040319095840.GD1228@DervishD>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040318205201.GA1228@DervishD> <20040318211223.GA1543@xxxxxxxxxxx> <20040319095840.GD1228@DervishD>
In the last episode (Mar 19), DervishD said:
> Hi Clint :)
>
> * Clint Adams <clint@xxxxxxx> dixit:
> > > print -l `seq 0 10`
> > > entirely using Zsh. How can I replace the 'seq'???
> > 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;
{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.
--
Dan Nelson
dnelson@xxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author