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

25 lines
362 B

#!/bin/sh
if [ $# -eq 0 ]; then
set -- "$HOME/projects"
fi
find_delete_me() {
local depth="$1" x=
shift
for x; do
if [ ! -e "$x" ]; then
:
elif [ "${x##*/}" = "delete-me" ]; then
echo "$x"
elif [ $depth -gt 0 ]; then
find_delete_me $(( depth - 1 )) "$x"/*
fi
done
}
find_delete_me 4 "$@" | while read x; do
echo "# $x"
rm -rf "$x"
done