From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17253 invoked from network); 2 Sep 2005 19:21:18 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 2 Sep 2005 19:21:18 -0000 Received: (qmail 35462 invoked from network); 2 Sep 2005 19:21:11 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 2 Sep 2005 19:21:11 -0000 Received: (qmail 15783 invoked by alias); 2 Sep 2005 19:21:03 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9371 Received: (qmail 15772 invoked from network); 2 Sep 2005 19:21:02 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 2 Sep 2005 19:21:02 -0000 Received: (qmail 34516 invoked from network); 2 Sep 2005 19:21:02 -0000 Received: from whisk.dreamhost.com (205.196.208.4) by a.mx.sunsite.dk with SMTP; 2 Sep 2005 19:20:58 -0000 Received: from [192.168.1.4] (unknown [68.250.189.88]) by whisk.dreamhost.com (Postfix) with ESMTP id 5484C175110 for ; Fri, 2 Sep 2005 12:20:54 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v734) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: zsh-users@sunsite.dk From: Timothy Luoma Subject: trying to match yyyy-mm-dd what am I missing? Date: Fri, 2 Sep 2005 15:20:49 -0400 X-Mailer: Apple Mail (2.734) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) 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.0.4 I am trying to match all folders in the CWD which are in the format YYYY-MM-DD. Actually I'm just trying to match the ones from 2000 so I am using 2[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] as my regex. This is my script: for i in * do if [ -d "$i" ] then if [ "$i" = 2[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] ] then echo "YES: $i" else echo "no: $i" fi fi done Here are the results: YES: 2005-08-24/ no: 2005-08-26/ no: 2005-08-27/ no: 2005-08-28/ no: 2005-08-29/ no: access.log/ So it is only matching the first one, and I can't figure out why. TjL ps - actually I eventually want to match any file/folder that is NOT (a directory AND in yyyy-mm-dd format)