Just discovered the -delete option to "find". It's a little scary. Make
sure you put the -delete at the very end:
$ mkdir -p temp/one/two/three
$ find temp/ -type d -empty
temp/one/two/three
$ find temp/ -type d -empty -delete
$ find temp/ -type d -empty
find: `temp': No such file or directory
I think I still prefer the xargs approach, using rmdir:
$ find temp/ -type d -empty -print0 | xargs -0 rmdir -p
Douglas.
=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================