A script that deletes files.

I want to write a script that deletes files inside the dir. However, the script
should also allow the user to confirm by pressing (d) key before deleting files..

#!/bin/bash
for file in $1/*
do
        size='ls -l $file | cut -f 5 -d " "'
        name='ls -l $file | cut -f 9 -d " "'
        let "rem=$size%2"
        if [ $rem -eq 0 ]; then
                echo "file $name is to be deleted"
                read -p "press <d> to confirm" answer
                if [ "$answer" == "d" ]; then
                        rm $name
                fi
        fi
done

The -i option of rm command ask for confirmation
(ok it will not be by pressing 'd' key but 'y')

for f in $1/*
do rm -i $f
done