>>> Hi All
>>> I am required to add some additional functionality to rm command. For
>>> examople displaying the space being freed on deletion of the file. For
>>> that I dont want to make any changes to the existing rm command. But I
>>> need to define some utility with same name as rm. Such that my utility
>>> shpould be called whenevr the user issues the rm utitlity. How to do
>>> that ? Please guide.
>> Please don't multi-post. Your question has been answered in
>> another newsgroup.
>> The best advice is: don't; use a different name. Changing the
>> behaviour of rm is likeley to break existing scripts.
> cLIeNUX rm won't rm -rf /
I believe the latest POSIX specs require rm to consider that
command an error.
Quote:> If you have that in a script, be glad I broke it ;o)
And what happens if you have that in a script and run it on a
different machine, where there is no such protection?
It's much safer to learn how to code correctly and safely.
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
==================================================================
Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
<http://www.torfree.net/~chris/books/cfaj/ssr.html>