Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Regexp type pattern matching
- X-seq: zsh-workers 24975
- From: Peter Stephenson <pws@xxxxxxx>
- To: "Jerry Rocteur" <macosx@xxxxxxxxxx>
- Subject: Re: Regexp type pattern matching
- Date: Thu, 08 May 2008 10:00:41 +0100
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <30735.153.98.68.197.1210236493.squirrel@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <30735.153.98.68.197.1210236493.squirrel@xxxxxxxxxxxxxxxxxxx>
"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'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
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author