You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
244 B
Plaintext

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