rmdir-empty: take directory arguments

master
neingeist 2 years ago
parent a295c5c0c6
commit 7bc79861e1

@ -1,5 +1,15 @@
#!/bin/sh
# recursively delete empty directories
find . -depth \
-path "." -prune -or \
-type d -empty -exec rmdir -v {} \;
rmdir_empty() {
# make default . explicit
if [ -z "$1" ]; then
set -- .
fi
find "$@" -depth \
-path "." -prune -or \
-type d -empty -exec rmdir -v {} \;
}
rmdir_empty "$@"

Loading…
Cancel
Save