#!/bin/sh # # Call rm. Prompt if attempting to remove *. Otherwise, flame away. RM=/bin/rm while getopts :fRr o do case $o in *) RM="${RM} -${o}";; esac done shift $(($OPTIND - 1)) if [ "`echo *`" = "$*" ] then printf 'remove everything? ' read a if [ "$a" = "y" ] then ${RM} -- "$@" fi else ${RM} -- "$@" fi