From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17190 invoked from network); 12 Jul 2004 14:10:21 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 12 Jul 2004 14:10:21 -0000 Received: (qmail 3679 invoked from network); 12 Jul 2004 14:13:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Jul 2004 14:13:35 -0000 Received: (qmail 18668 invoked by alias); 12 Jul 2004 14:09:40 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7686 Received: (qmail 18654 invoked from network); 12 Jul 2004 14:09:40 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 12 Jul 2004 14:09:40 -0000 Received: (qmail 2595 invoked from network); 12 Jul 2004 14:13:00 -0000 Received: from born.physik.uni-dortmund.de (129.217.160.155) by a.mx.sunsite.dk with SMTP; 12 Jul 2004 14:12:47 -0000 Received: by born.physik.Uni-Dortmund.DE (Postfix, from userid 1014) id 16F5811386; Mon, 12 Jul 2004 16:09:01 +0200 (CEST) Date: Mon, 12 Jul 2004 16:09:01 +0200 From: Klaus Wacker To: ZSH User List Subject: Re: Maildir empty? Message-ID: <20040712140900.GP2860@born.physik.uni-dortmund.de> Reply-To: wacker@Physik.Uni-Dortmund.DE References: <20040712073705.GN2860@born.physik.uni-dortmund.de> <690.1089625465@trentino.logica.co.uk> <20040712124144.GO2860@born.physik.uni-dortmund.de> <20040712132221.GA818@DervishD> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040712132221.GA818@DervishD> User-Agent: Mutt/1.4i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_44 autolearn=no version=2.63 X-Spam-Hits: -0.0 On Mon, Jul 12, 2004 at 03:22:21PM +0200, DervishD wrote: > Hi Klaus and Oliver :) > > * Klaus Wacker dixit: > > > Does this do what you want: > > > if [ -z $i/*/*([1]) ] > > > You need to use the single brackets so that the $i/*/* is treated as a > > > filename expansion. > > Why are single brackets needed here instead of [[ -z ... ]]? Why > with single brackets the $i/*/* construction is treated as a filename > expansion? Is it not using double brackets? > I can only give a partial answer. `[' is treated like any other command, so its arguments are subject to filename expansion. The closing `]' is basically ignored. Zsh has `[' as a built-in, but there is also /usr/bin/[. `[[...]]' is a real shell construct with its own syntax and rules. Don't ask me what exactly the rules are, but essentially they are geared more towards pattern matching than file globbing, if I remember correctly. -- Klaus Wacker wacker@Physik.Uni-Dortmund.DE Experimentelle Physik V http://www.physik.uni-dortmund.de/~wacker Universitaet Dortmund Tel.: +49 231 755 3587 D-44221 Dortmund Fax: +49 231 755 4547