-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to ShprotX on 2/9/2008 8:21 AM: | I have an idea how to reduce the likelihood of damage from typos in | using of rm. rm needs one option in which specified files/dirs aren't | deleted until one of them doesn't exist (including deleting of | directories without "-r" option). In this way an accidental space or | missing quotes won't result in deleting of wrong files in most cases.
Thanks for the report. 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? - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHrdCi84KuGfSFAYARAv/mAKCd76JHiqFVFTGOcJnjKwf7+oi36QCaA7Xh uWmmOlaRNBdsgYgg1bHXi1U= =Vl+Z -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
