On Wed, Sep 23, 2009 at 08:21:35AM -0500, Kyle Wheeler wrote: > On Wednesday, September 23 at 08:16 PM, quoth Wu, Yue: > >Hi, list, question is how to use some commands(i.g. shell commands) to remove > >the empty maildirs, i.e. no any file in maildirs' new/ cur/ and tmp/? > > If you know it won't be re-created or delivered to while you're > fussing with it, you can just use `rm -r maildirname` or even `rmdir > maildirname/new maildirname/cur maildirname/tmp maildirname`
Maybe I did not describe clearly. I'm sure them won't be re-created while I'm removing them. I just need a way to determine if a maildir is empty(it should has the empty new/ tmp/ cur/ respectively), then remove the empty maildir. `rm -r maildirname` doesn't help me to determine if the maildirname is empty. `rmdir maildirname/new maildirname/cur maildirname/new maildirname` isn't a rock way, because if one of a maildir's child dirs(new/ cur/ tmp) is lost, then mutt won't regonize the maildir mailboxes. The logic I need is: if maildir A has no mails(new/ tmp/ cur/ are empty) rm -r A endif -- Hi, Wu, Yue