Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Regexp type pattern matching
- X-seq: zsh-workers 24977
- From: "Jerry Rocteur" <macosx@xxxxxxxxxx>
- To: "Peter Stephenson" <pws@xxxxxxx>, zsh-workers@xxxxxxxxxx
- Subject: Re: Regexp type pattern matching
- Date: Thu, 8 May 2008 11:09:39 +0200 (CEST)
- Importance: Normal
- In-reply-to: <200805080900.m4890fnu005197@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <30735.153.98.68.197.1210236493.squirrel@xxxxxxxxxxxxxxxxxxx> <200805080900.m4890fnu005197@xxxxxxxxxxxxxx>
> "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 ?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author