From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1485 invoked from network); 19 Nov 2005 19:39:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 19 Nov 2005 19:39:30 -0000 Received: (qmail 12171 invoked from network); 19 Nov 2005 19:39:23 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 19 Nov 2005 19:39:23 -0000 Received: (qmail 2560 invoked by alias); 19 Nov 2005 19:39:16 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9702 Received: (qmail 2551 invoked from network); 19 Nov 2005 19:39:15 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 19 Nov 2005 19:39:15 -0000 Received: (qmail 10997 invoked from network); 19 Nov 2005 19:39:15 -0000 Received: from vms042pub.verizon.net (206.46.252.42) by a.mx.sunsite.dk with SMTP; 19 Nov 2005 19:39:13 -0000 Received: from candle.brasslantern.com ([71.116.81.225]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0IQ7005B8VX96UG5@vms042.mailsrvcs.net> for zsh-users@sunsite.dk; Sat, 19 Nov 2005 13:39:10 -0600 (CST) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id jAJJd8PT020334; Sat, 19 Nov 2005 11:39:08 -0800 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id jAJJd8fp020333; Sat, 19 Nov 2005 11:39:08 -0800 Date: Sat, 19 Nov 2005 19:39:07 +0000 From: Bart Schaefer Subject: Re: listing/deleting empty directories recursively In-reply-to: To: zzapper , zsh-users@sunsite.dk Message-id: <1051119193907.ZM20332@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <200511191057.25776.cht@chello.at> <103un195cji6u17l0kj1ijkvfj2vn9o3r5@4ax.com> <1051119160931.ZM19308@candle.brasslantern.com> Comments: In reply to zzapper "Re: listing/deleting empty directories recursively" (Nov 19, 5:07pm) On Nov 19, 5:07pm, zzapper wrote: } Subject: Re: listing/deleting empty directories recursively } } > rmdir --verbose **/*(/od) } I presume this can be xarg? Or zargs, as Stephane suggested. } The disadvantage of this is that it produces a flood of warning } messages which may prevent you spotting something untoward. I guess the question is whether you want a short command or minimal output. You can do the recursive descent yourself, of course. function rmemptydir() { emulate -RL zsh local here=$REPLY local -a deep deep=( $here/*(N/+rmemptydir) ) [[ -n $deep ]] && rmdir --verbose $deep reply=( $here(N^F) ) } : *(N/+rmemptydir) This all assumes a version of zsh recent enough that recursive calls to the (e) glob qualifier don't cause a crash, and so that you have the (+) qualifier shortcut.