zsh-users
 help / color / mirror / code / Atom feed
From: Dan Nelson <dnelson@allantgroup.com>
To: Clint Adams <clint@zsh.org>, Zsh Users <zsh-users@sunsite.dk>
Subject: Re: How to generate a list of numbers without 'seq'?
Date: Fri, 19 Mar 2004 10:34:25 -0600	[thread overview]
Message-ID: <20040319163425.GF99558@dan.emsphone.com> (raw)
In-Reply-To: <20040319095840.GD1228@DervishD>

In the last episode (Mar 19), DervishD said:
>     Hi Clint :)
> 
>  * Clint Adams <clint@zsh.org> 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@allantgroup.com


  reply	other threads:[~2004-03-19 16:34 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 [this message]
2004-03-20 10:00       ` DervishD
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=20040319163425.GF99558@dan.emsphone.com \
    --to=dnelson@allantgroup.com \
    --cc=clint@zsh.org \
    --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).