From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22201 invoked from network); 23 Jan 2006 10:52:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Jan 2006 10:52:11 -0000 Received: (qmail 96921 invoked from network); 23 Jan 2006 10:52:04 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Jan 2006 10:52:04 -0000 Received: (qmail 24672 invoked by alias); 23 Jan 2006 10:51:57 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9845 Received: (qmail 24623 invoked from network); 23 Jan 2006 10:51:56 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 23 Jan 2006 10:51:56 -0000 Received: (qmail 95839 invoked from network); 23 Jan 2006 10:51:56 -0000 Received: from cluster-d.mailcontrol.com (HELO rly33d.srv.mailcontrol.com) (217.69.20.190) by a.mx.sunsite.dk with SMTP; 23 Jan 2006 10:51:52 -0000 Received: from exchange03.csr.com (uuk202166.uk.customer.alter.net [62.189.241.194] (may be forged)) by rly33d.srv.mailcontrol.com (MailControl) with ESMTP id k0NApOlJ030364 for ; Mon, 23 Jan 2006 10:51:48 GMT Received: from csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 23 Jan 2006 10:45:20 +0000 To: zsh-users@sunsite.dk Subject: Re: string starts with ... In-reply-to: <1060121170201.ZM20033@candle.brasslantern.com> References: <20060121135331.GA557@antares.ba-leipzig.de> <87oe254qx8.fsf@trews52.bothi.fi> <1060121170201.ZM20033@candle.brasslantern.com> Comments: In-reply-to Bart Schaefer message dated "Sat, 21 Jan 2006 17:02:01 +0000." Date: Mon, 23 Jan 2006 10:45:10 +0000 From: Peter Stephenson Message-ID: X-OriginalArrivalTime: 23 Jan 2006 10:45:20.0355 (UTC) FILETIME=[1B210B30:01C6200A] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-05-40-01 (www.mailcontrol.com) on 10.68.0.143 Bart Schaefer wrote: > This works, too, by forcing the '#' to be treated as part of a pattern: > > [[ $YOURSTRING == (#)* ]] You mean with extendedglob turned off. I tried it with extendedglob turned on (this is for aficionados only): % [[ 'foo' = (#)foo ]] && echo yes yes It looks like it's valid to have zero globbing flags. The manual doesn't actually say this in as many words, but it's sort of useful: % typeset approx % [[ foo = (#$approx)fo ]] && echo yes % approx=a1 % [[ foo = (#$approx)fo ]] && echo yes yes Note no globsubst trickery needed: $approx can be a straight string as long as the # is unquoted. This probably needs documenting. However, I think all globbing flags can be turned off by other flags, so having none isn't actually that useful. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.html