From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22467 invoked from network); 8 May 2008 09:09:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 May 2008 09:09:55 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 56588 invoked from network); 8 May 2008 09:09:51 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 May 2008 09:09:51 -0000 Received: (qmail 5712 invoked by alias); 8 May 2008 09:09:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24977 Received: (qmail 5699 invoked from network); 8 May 2008 09:09:48 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 8 May 2008 09:09:48 -0000 Received: from incc.be (incc.rocteur.com [65.99.212.71]) by bifrost.dotsrc.org (Postfix) with ESMTP id AA01B80ED172 for ; Thu, 8 May 2008 11:09:44 +0200 (CEST) Received: by incc.be (Postfix, from userid 1000) id E78B44050F; Thu, 8 May 2008 09:09:39 +0000 (UTC) Received: from webmail.rocteur.com (localhost [127.0.0.1]) by incc.be (Postfix) with ESMTP id 7DEE840509; Thu, 8 May 2008 09:09:39 +0000 (UTC) Received: from 153.98.68.197 (SquirrelMail authenticated user jerry) by webmail.rocteur.com with HTTP; Thu, 8 May 2008 11:09:39 +0200 (CEST) Message-ID: <64874.153.98.68.197.1210237779.squirrel@webmail.rocteur.com> In-Reply-To: <200805080900.m4890fnu005197@news01.csr.com> References: <30735.153.98.68.197.1210236493.squirrel@webmail.rocteur.com> <200805080900.m4890fnu005197@news01.csr.com> Date: Thu, 8 May 2008 11:09:39 +0200 (CEST) Subject: Re: Regexp type pattern matching From: "Jerry Rocteur" To: "Peter Stephenson" , zsh-workers@sunsite.dk User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: ClamAV 0.91.2/7060/Thu May 8 08:07:49 2008 on bifrost X-Virus-Status: Clean > "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] 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 ?