#!/bin/sh # rr - A safe and convenient command somewhere between 'rm -rf' and 'rm -ri' for d; do if [ -d "$d" ]; then read -p "Remove directory '$d' and all of its contents? (I will not ask about any files or subdirectories!) " do_it case "$do_it" in y|Y|yes) rm -rf "$d" esac else rm -i "$d" fi done