From: DervishD <raul@pleyades.net>
To: Dan Nelson <dnelson@allantgroup.com>
Cc: Clint Adams <clint@zsh.org>, Zsh Users <zsh-users@sunsite.dk>
Subject: Re: How to generate a list of numbers without 'seq'?
Date: Sat, 20 Mar 2004 11:00:00 +0100 [thread overview]
Message-ID: <20040320100000.GA302@DervishD> (raw)
In-Reply-To: <20040319163425.GF99558@dan.emsphone.com>
Hi Dan :)
* Dan Nelson <dnelson@allantgroup.com> 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/
next prev parent reply other threads:[~2004-03-20 9:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-18 20:52 DervishD
2004-03-18 21:12 ` Clint Adams
2004-03-19 9:58 ` DervishD
2004-03-19 16:34 ` Dan Nelson
2004-03-20 10:00 ` DervishD [this message]
2004-03-21 3:54 ` Dan Nelson
2004-03-21 12:06 ` DervishD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040320100000.GA302@DervishD \
--to=raul@pleyades.net \
--cc=clint@zsh.org \
--cc=dnelson@allantgroup.com \
--cc=zsh-users@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).