[Top][All Lists]


Re: Typos protection for rm

From: Pavel Kostyuchenko
Subject: Re: Typos protection for rm
Date: Sat, 09 Feb 2008 20:53:40 +0200
User-agent: Thunderbird (X11/20071022)

Eric Blake wrote:
First things first - POSIX specifies the current
behavior of rm without options, so we cannot change the default behavior.
~ So the only way to change things is with an option.  But adding options
from the command line every time involves more typing, so it is less
likely to be done by the user.  Therefore, the only way to make rm safer
is via an alias or wrapper script which adds the desired options on your
behalf.  On the other hand, if systems provide such wrappers, and still
name it by rm, then users get used to the 'extra' protection on their
system, and then fail spectacularly when moving to other systems that
don't provide such wrappers.  Therefore, on this list, we recommend that
you consider giving any such wrapper script a separate name (in this case,
maybe del or delete), to make it explicit to the user that they are not
invoking raw rm.

That said, rm already comes with options -i and -I, which were both
designed to reduce the likelihood of unintentional damage.  Is there
anything wrong with rm's existing set of options that cannot accomplish
what you wanted in the context of an alias?
rm's options are all right, but option -i is almost useless and in my system there's no "-I" option. Looks like a separate script would be the best decision.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]