zsh-workers
 help / color / mirror / code / Atom feed
From: "Jerry Rocteur" <macosx@rocteur.cc>
To: "Peter Stephenson" <pws@csr.com>, zsh-workers@sunsite.dk
Subject: Re: Regexp type pattern matching
Date: Thu, 8 May 2008 11:09:39 +0200 (CEST)	[thread overview]
Message-ID: <64874.153.98.68.197.1210237779.squirrel@webmail.rocteur.com> (raw)
In-Reply-To: <200805080900.m4890fnu005197@news01.csr.com>

> "Jerry Rocteur" wrote:
>> Hi,
>>
>> I'm runnign a script under Zsh 4.2.6 on Redhat
>>
>> I'm spawning an egrep to do pattern matching:
>>
>> if echo ${USER_NAME}|egrep -q "^[prt][0-9]"
>>
>> But after a while this stops working and I get:
>> rt_sigsuspend(~[HUP CHLD RTMIN RT_1] <unfinished ...
> It might be worth trying with a more recent version of the shell; there
> are a few fixes for job handling.  If you're spawning a *lot* of
> processes it might be the one I've just fixed, zsh-users/12815.

I'll pass that onto the powers that be, thanks.

>> I've tried to find examples but how do I do this pattern matching in zsh with
>> out using egrep:
>>
>> if echo ${USER_NAME}|egrep -q "^[prt][0-9]"
>
> It's straightforward...
>
>   if [[ $USER_NAME = [prt][0-9]* ]]; then
>     ...
>   fi

Oops..

you know I tried that but instead of = I put =~ and it did not work.

Thanks very much for this information I really appreciate it.

Jerry
P.S. Can you please tell me which manual this [[ $USER_NAME = [prt][0-9]* ]] is explained, I looked this morning for a
few hours and I didn't seen anything like this ?


  reply	other threads:[~2008-05-08  9:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-08  8:48 Jerry Rocteur
2008-05-08  9:00 ` Peter Stephenson
2008-05-08  9:09   ` Jerry Rocteur [this message]
2008-05-08  9:50     ` Stephane Chazelas

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=64874.153.98.68.197.1210237779.squirrel@webmail.rocteur.com \
    --to=macosx@rocteur.cc \
    --cc=pws@csr.com \
    --cc=zsh-workers@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).