From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29445 invoked from network); 18 May 2009 09:16:37 -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 09:16:37 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 14439 invoked from network); 18 May 2009 09:16:06 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 May 2009 09:16:06 -0000 Received: (qmail 14947 invoked by alias); 18 May 2009 09:15:13 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14132 Received: (qmail 14919 invoked from network); 18 May 2009 09:15:10 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 18 May 2009 09:15:10 -0000 Received: from atom.smasher.org (atom.smasher.org [69.55.237.145]) by bifrost.dotsrc.org (Postfix) with SMTP id C26718027106 for ; Mon, 18 May 2009 11:14:57 +0200 (CEST) Received: (qmail 83280 invoked by uid 1000); 18 May 2009 09:14:55 -0000 Message-ID: <20090518091455.83279.qmail@smasher.org> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Date: Mon, 18 May 2009 21:14:48 +1200 (NZST) From: Atom Smasher MIME-Version: 1.0 OpenPGP: id=0xB88D52E4D9F57808; algo=1 (RSA); size=4096; url=http://atom.smasher.org/pgp.txt Subject: [[ -f file* ]] To: zsh-users@sunsite.dk X-POM: The Moon is Waning Crescent (40% of Full) X-Hashcash: 1:20:0905180914:zsh-users@sunsite.dk::m4Rg1jFMXEKRpoFF:0000000000000 0000000000000000000000004OrP X-Virus-Scanned: ClamAV 0.94.2/9366/Mon May 18 08:02:23 2009 on bifrost X-Virus-Status: Clean 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. so far this seems like the best way to do it: { ls test* } 2> /dev/null | read -k 2 -u 0 if one or more files match the pattern "test*", read returns 0. if no files match the pattern, read returns >0. is there a better way? thanks... -- ...atom ________________________ http://atom.smasher.org/ 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808 ------------------------------------------------- "Wars not make one great." -- Yoda