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: Sat, 20 Mar 2004 21:54:21 -0600	[thread overview]
Message-ID: <20040321035420.GB2097@dan.emsphone.com> (raw)
In-Reply-To: <20040320100000.GA302@DervishD>

In the last episode (Mar 20), DervishD said:
> 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)?

It should work any time zsh does pattern matching:

  $ [[ 4 == <1-5> ]] && echo yes || echo no
  yes
  $ [[ 6 == <1-5> ]] && echo yes || echo no
  no

including case statements and ${var%%pattern} searches.

 
-- 
	Dan Nelson
	dnelson@allantgroup.com


  reply	other threads:[~2004-03-21  3:54 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
2004-03-21  3:54         ` Dan Nelson [this message]
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=20040321035420.GB2097@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).