From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2269 invoked from network); 12 Jul 2004 07:39:26 -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 07:39:26 -0000 Received: (qmail 31501 invoked from network); 12 Jul 2004 07:41:50 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 Jul 2004 07:41:50 -0000 Received: (qmail 14870 invoked by alias); 12 Jul 2004 07:38:15 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7680 Received: (qmail 14860 invoked from network); 12 Jul 2004 07:38:14 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 12 Jul 2004 07:38:14 -0000 Received: (qmail 29538 invoked from network); 12 Jul 2004 07:40:56 -0000 Received: from born.physik.uni-dortmund.de (129.217.160.155) by a.mx.sunsite.dk with SMTP; 12 Jul 2004 07:40:42 -0000 Received: by born.physik.Uni-Dortmund.DE (Postfix, from userid 1014) id 5FA8911386; Mon, 12 Jul 2004 09:37:05 +0200 (CEST) Date: Mon, 12 Jul 2004 09:37:05 +0200 From: Klaus Wacker To: ZSH User List Subject: Maildir empty? Message-ID: <20040712073705.GN2860@born.physik.uni-dortmund.de> Reply-To: wacker@Physik.Uni-Dortmund.DE Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 Dear zsh, is there a zsh-internal way to find out whether a maildir is empty? Or more generally, whether a directory tree contains no files? The following test ($i is the pathname of the maildir): if [[ $(echo $i/*/* | wc -w) -eq 0 ]] works with `setopt extendedglob nullglob', but I am sure there is some combination of {}[]()$#@% which avoids spawning of a subshell and an external program. -- 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