#!/usr/bin/perl use File::Find; finddepth (\&empdir, ($ARGV[0] || '.')); sub empdir { return unless -d && rmdir($_); mkdir "/tmp/$_"; }
Works for me in GNU. Any "empty" directory having only empty subdirectories will be deleted also (as the empty subdirs). Adapt the line 7 to your needs
In reply to Re: How do I copy an empty directory?
by pvaldes
in thread How do I copy an empty directory?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |