From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3070 invoked by alias); 29 Jun 2015 15:45:18 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35661 Received: (qmail 4989 invoked from network); 29 Jun 2015 15:45:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: * X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,FSL_HELO_BARE_IP_2,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, RCVD_NUMERIC_HELO,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.0 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Stephane Chazelas Subject: Re: Tip of the day: prune empty directory hierarchies Date: Mon, 29 Jun 2015 16:43:50 +0100 Message-ID: <20150629154350.GB5362@chaz.gmail.com> References: <20150629155927.289729cb__2821.95612458072$1435590676$gmane$org@pwslap01u.europe.root.pri> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 2.217.126.102 Content-Disposition: inline In-Reply-To: <20150629155927.289729cb__2821.95612458072$1435590676$gmane$org@pwslap01u.europe.root.pri> User-Agent: Mutt/1.5.21 (2010-09-15) 2015-06-29 15:59:27 +0100, Peter Stephenson: [...] > local -aU dirs > > dirs=(**/*(ND/^F)) > while (( ${#dirs} )); do > rmdir $dirs || return [...] Missing -- above. With GNU `find`: find . -depth -type d -empty -delete -- Stephane