Menu for Purge

I have these commands that help me find and delete files over certain days.

How can I build a menu to list the files, and then hit y for yes to delete or no?

find /logs/212/abinitio/prod/mfs/partitions/part0/mfs_12way_001/mfs_12way/sncrpt/main/ -name "*dat" -mtime +1 -exec ls -ltr {} \;
find /cddata/bi/logs/212/data/cdr/ -name "*dat" -mtime 10 -exec ls -ltr {} \;
find /logs/212/data/cem/ -name "*dat" -mtime 10 -exec ls -ltr {} \;

find /logs/212/abinitio/prod/mfs/partitions/part0/mfs_12way_001/mfs_12way/sncrpt/main/ -name "*dat" -mtime +1 -exec rm -rf {} \;
find /cddata/bi/logs/212/data/cdr/ -name "*dat" -mtime 10 -exec rm -rf {} \;
find /logs/212/data/cem/ -name "*dat" -mtime 10 -exec rm -rf {} \;

You don't need to create a menu. If you change:

-exec rm -rf {} \;

to

-ok rm -rf {} \;

find will show you the rm command it is ready to execute and ask you whether to run it or skip it for each selected file. Alternatively, you could use:

-exec rm -ri {} +

to have rm do the prompting and have find run rm fewer times.

and then I need to log the files deleted as well.

---------- Post updated at 03:02 PM ---------- Previous update was at 03:00 PM ----------

Well I have about 25 more directories and with different -mtimes so I was going to make a menu so that we could go through all of them one at a time, verify visually before we delete them?

---------- Post updated at 03:03 PM ---------- Previous update was at 03:02 PM ----------

I also don't want them to ask Y or N for each file but for each dir.

ask() { # "Question to ask"
# Ask a question (y/n)
# Returns 0 for yes, 1 for no
    read -n1 -p "$1 (y/n): " ANSWER
    [ [yjso] = "$ANSWER" ] && return 0 || return 1
    # Returns YES (0) for yes, si, oui, ja (first letters)
}

BASE=/some/dir
cd $BASE

for FOUND in $(find . -name);do     ### might become ARG_MAX, but you said its only ~25
    [ -d $FOUND ] && \
       ask "Delete: $FOUND and all subdirectories?" && \
       rm -fr $FOUND
done

Hth & gn8
Do on your own risk - untested too tired on windows...