Find occurances of a directory and count

I am writing my first shell script to do the following:

  1. Find all occurrences of a directory from the pwd
  2. Delete the directory (which is a hidden directory)
  3. Provide feedback w/ the number of directories deleted

The problems I am having are two-fold:

  1. The user may not have the appropriate privileges to delete the directory
  2. grep -c counts the total number of lines returned, rather than the total number of unique occurrences of the directory

For example, I want to let the user know how my directories called "delete_me" were deleted. If the directory structure is /.delete_me/subdir1/subdir2, grep -c returns "3" (/.delete_me, /.delete_me/subdir1, and /.delete_me/subdir1/subdir2). I want to tell the user that 1 directory called ".delete_me" was deleted. How can this be done?

My other problem deals w/ the user not having privileges to delete the directory, or getting feedback on all the directories accessed during the "find" that they don't have permission to read. Ideally, the script would be run w/ root privileges, but I can only get it to run w/ the privileges assigned to the user running the script.

A copy of my code is below. I am just testing, so right now I am not deleting any directories, just finding them and printing to stdout.

echo "Are you sure you want to recursively delete all .delete_me directories under the current directory? [y/n]: "
echo "Current Directory: `pwd`" 

read answer
case "$answer" in
  y)
    find . -name .delete_me -print
    echo "Number of .delete_me Directories Deleted:"
    find . -print | grep  -c '.parent' 
  n)
    echo  "<--- Operation Aborted! --->";;
  *)
    echo \""$answer"\" is not an option.  Please select \"y\" or \"n\".;;
esac
exit 0

Any help would be greatly appreciated. Thanks in advance.

Ken

What you want to do can be done as follows:

echo "Are you sure you want to recursively delete all .delete_me directories under the current directory? [y/n]: "
echo "Current Directory: `pwd`" 

read answer
case "$answer" in
  y)
    find . -name .delete_me -print
    echo "Number of .delete_me Directories Deleted:"
    find . -name .delete_me -print | grep  -c '.parent' 
  n)
    echo  "<--- Operation Aborted! --->";;
  *)
    echo \""$answer"\" is not an option.  Please select \"y\" or \"n\".;;
esac
exit 0

Thanks Blowtorch, that worked.