zsh-users
 help / color / mirror / code / Atom feed
From: "Thomas Köhler" <jean-luc@picard.franken.de>
To: ZSH User List <zsh-users@sunsite.dk>
Subject: Re: something simple (I hope)
Date: Mon, 4 Aug 2003 17:51:30 +0200	[thread overview]
Message-ID: <20030804155130.GA2199@picard.franken.de> (raw)
In-Reply-To: <20030804153810.GA17793@spiegl.de>

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

Andy Spiegl wrote [2003/08/04]:
> > > I want to put all files that match the regex pattern
> > >  "^/var/tmp/exec\.[0-9]+$"
> > > into a list that I can then use in a foreach loop.
> 
> > for i in /var/tmp/exec.[0-9][0-9]* ; do echo $i ; done
> Thanks but I really need a list (with a name).
> Actually in the meantime I found out how to do that:
>  files=(/var/tmp/exec.[[:digit:]]*)
> 
> But what is still bugging me is that this also matches files like
>  /var/tmp/exec.01234.something
> 
> I can't figure out how to tell zsh that there shouldn't be anything _after_
> digits.  What is the zsh-equivalent of a $ in regular expressions?

I have no idea for the "$" problem, but have you tried this?
files=(/var/tmp/exec.<->)
                     ^^^
                     <[n]-[m]> matches any number in the range n
                     to m, both of which are optional...

> Thanks again,
>  Andy.

Ciao,
Thomas

-- 
 Thomas Köhler Email:   jean-luc@picard.franken.de     | LCARS - Linux
     <><        WWW:     http://jeanluc-picard.de      | for Computers
                IRC:             jeanluc               | on All Real
               PGP public key available from Homepage! | Starships

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2003-08-04 15:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-04 14:33 Andy Spiegl
2003-08-04 15:10 ` Clint Adams
2003-08-04 15:12 ` Thomas Köhler
2003-08-04 15:38   ` Andy Spiegl
2003-08-04 15:49     ` Dan Nelson
2003-08-04 15:51     ` Thomas Köhler [this message]
2003-08-04 15:53     ` Bart Schaefer
2003-08-04 15:55     ` Peter Stephenson
2003-08-04 16:01       ` Andy Spiegl

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=20030804155130.GA2199@picard.franken.de \
    --to=jean-luc@picard.franken.de \
    --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).