Here is a sample shell front end to rm:
Code:
#!/bin/bash
###
### Shell front end for rm
###
case $# in
0) echo "no file or directory passed to rm"
exit 1;;
1) ## 1 variable passed (should be a file)
if [ -f $1 ]
then
/bin/rm $1
else
echo "File $1 not found"
exit 2
fi;;
2) ## 2 variables check for -r -f -rf options
l_force=`echo $1|sed 's/f//'`
if [ "$l_force" != "$1" ]
then
# -f found!
echo "Are you sure? Y/[N]"
read l_ans
case $l_ans in
[Yy]|[Yy][Ee][Ss]) /bin/rm $1 $2;;
*) exit 3;;
esac
else
/bin/rm $1 $2
fi;;
*) echo "Syntax rm [options] [file(s) or directory]";;
esac
Save the file as new rm somewhere where everyone can access it eg: /usr/local/newrm
change permissions so everyone can execute it eg: chmod 755 /usr/local/newrm
add an alias for rm eg: alias rm='/usr/local/newrm'
Please note that I have not catered for the full option range supported by rm.
Feel free to modify the script in any way to better fit your needs.