Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Tip of the day: prune empty directory hierarchies
- X-seq: zsh-workers 35680
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Tip of the day: prune empty directory hierarchies
- Date: Fri, 3 Jul 2015 21:29:10 +0100
- In-reply-to: <XnsA4CCD67999476davidrayninfocouk__25443.3464644992$1435953977$gmane$org@80.91.229.13>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20150629155927.289729cb@pwslap01u.europe.root.pri> <XnsA4CCD67999476davidrayninfocouk__25443.3464644992$1435953977$gmane$org@80.91.229.13>
2015-07-03 20:04:41 +0000, zzapper:
> Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote in
> news:20150629155927.289729cb@xxxxxxxxxxxxxxxxxxxxxxxxx:
>
> > dirs=(**/*(ND/^F))
>
> I'd appreciate a fuller explanation
[...]
**/* recursive glob: any file in current directory and below.
(ND/^F): glob qualifier: modify glob behaviour and further
filter files based on other attributes than name:
N: don't fail and don't expand to anything if there's no match
(nullglob)
D: include dot files and descend into dot dirs (don't ignore
hidden files).
/: select only files of type directory
^F: directories that are /not-full/. a "full" directory here is
one that contains at least one entry other than . and ..
Do **/*(ND/^F) is the list of empty directories (recursively).
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author