Quote:
Originally Posted by unSpawn
What you should do is put rm back to where it was and forget using aliases or scripts like yours.... besides replacing a system binary with a kludge isn't standards compliant anyway.
|
I completely agree on that part, but
Quote:
Originally Posted by unSpawn
Aliases can evaded, don't cover applications removing files and scripts can behave unexpectedly.
|
I think that is one case in which something like this (not this, exactly, but something along similar lines) can make sense; if you are concerned about 'finger trouble' with a powerful command like 'rm -Rf' and variants thereof, then aliasing it to something that gives you a second chance can make sense (of course, you can also argue that someone who is not in control of what their fingers do shouldn't be in possession of a computer...not that I would make this argument, you understand).
If, of course, you replace a system binary, that changes things for all users; that seems sub-optimal.
Personally, I won't take any code seriously that is not in code tags or otherwise formatted for easy reading, because that means that the OP hasn't taken the effort to make it easy to read; why should hundreds of people have to make that effort because one didn't do it correctly? But, you'll have got exit codes wrong, everyone does.
So, when you try to update, uninstall or install software, expect the system not to perform the procedure correctly. In some cases, it will only be trivially different from a correct procedure, and the system will still work correctly. In others it won't.
Have Fun!