From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26772 invoked from network); 18 May 2009 11:42:11 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from new-brage.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.254.104) by ns1.primenet.com.au with SMTP; 18 May 2009 11:42:11 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 62931 invoked from network); 18 May 2009 11:41:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 May 2009 11:41:58 -0000 Received: (qmail 23167 invoked by alias); 18 May 2009 11:41:25 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14137 Received: (qmail 23150 invoked from network); 18 May 2009 11:41:24 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 18 May 2009 11:41:24 -0000 Received: from smtprelay10.ispgateway.de (smtprelay10.ispgateway.de [80.67.31.44]) by bifrost.dotsrc.org (Postfix) with ESMTP id B214E8027106 for ; Mon, 18 May 2009 13:41:19 +0200 (CEST) Received: from [212.117.84.140] (helo=fsst.voodoo.lan) by smtprelay10.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1M61DZ-0002qk-0H for zsh-users@sunsite.dk; Mon, 18 May 2009 13:41:19 +0200 Received: from hawk by fsst.voodoo.lan with local (Exim 4.69) (envelope-from ) id 1M61Cy-0001bQ-1k for zsh-users@sunsite.dk; Mon, 18 May 2009 13:40:40 +0200 Date: Mon, 18 May 2009 13:40:40 +0200 From: Frank Terbeck To: zsh-users@sunsite.dk Subject: Re: [[ -f file* ]] Message-ID: <20090518114040.GN15982@fsst.voodoo.lan> Mail-Followup-To: zsh-users@sunsite.dk References: <20090518091455.83279.qmail@smasher.org> <17393e3e0905180236v424b14d5ua9d364501662c75a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <17393e3e0905180236v424b14d5ua9d364501662c75a@mail.gmail.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Df-Sender: 430444 X-Virus-Scanned: ClamAV 0.94.2/9366/Mon May 18 08:02:23 2009 on bifrost X-Virus-Status: Clean Matt Wozniski : > On Mon, May 18, 2009 at 5:14 AM, Atom Smasher wrote: > > if i want to test for the presence of one or more files matching a certain > > pattern, it seems non-trivial to do it with the normal "test" or conditional > > expressions. > ... > > is there a better way? > > Well, off the top of my head, I can think of > > [ -n "$(print -- test*(N))" ] > > but even that seems inelegant; I'm sure someone can chime in with > something better. How about this: [snip] set -- test*(N) (( $# > 0 )) [snap] Regards, Frank -- In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925