:
#!/bin/sh
#FILE: rmdir
#AUTHOR: Nitin Sampat {seismo.allegra}!rochester!ur-laser!nitin.uucp
#DATE: Dec 7, 1985
#PURPOSE: To remove directories even if there are files
#	  in them but to interactively seek confirmation
#	  first.
#NOTE: If this file resides in /usr/you/bin read from 
#      this directory first. i.e Check your PATH ! 
#      To execute , shell this file 
#PUBLIC DOMAIN : No gaurentees !!!!!

	case $# in 
		0) echo "Usage: rmdir dir";;
	esac

	for i  
	do   if /bin/rmdir $i			#first run original rmdir on argument(s)
             then        
	       	echo "$i directory deleted "	#rmdir successful 
	     else		 		#if original rmdir unsuccessful 
		 if test -d $i		 	#test if argument is a dir
	         then 
	           echo -n "Do you really want to delete $i (y/n): " #prompt confirmation
		   read answer
			case $answer in
		        	y) /bin/rm -r $i	#rmdir dir recursively
							#if user confirms deletion
				   echo "$i directory deleted";;
		    		*) ;;
			esac		
		 fi 	
	     fi
	done 
