Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Globbing for Empty Directories?



    Hi Aaron :)

 * Aaron Davies <agdavi01@xxxxxxxxxxxxxx> dixit:

> Is there a way to get empty directories from a glob pattern? '*(L0)' 
> finds empty files, but doesn't work for dirs. I'm looking for something 
> the equivalent of find's -empty argument, since I hate find with a 
> passion and would love to never use it again.

    There is not, AFAIK. See the mailing list archives, I asked more
or less the same a few months ago. Testing for the number of links
won't work for directories :(( The only way is to look whether the
directory has files in it, with some globbing pattern; if the
expansion is empty, then the directory is empty.

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/



Messages sorted by: Reverse Date, Date, Thread, Author