Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Do not make replacement versions or aliases for common programs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Do not make replacement versions or aliases for common programs
Authored by: Elliot Shank on Feb 29, '08 08:31:06AM

This is bad news. Don't create "safe" versions of things like cp, mv, rm, etc.

Why? Because you'll become dependent upon them and then, when you're on some other computer which doesn't have this sort of thing applied to it, you'll be surprised when the safety features don't kick in.

Either make a habit of passing -i to these commands or use a different name for the safe version. My equivalent of this hint is called "trash". This way, when I'm on another computer that isn't set up my way, if I make a mistake, I'll get a "command not found" error, rather than destroying data.

[ Reply to This | # ]
Uniform and consistent experiences
Authored by: SeanAhern on Feb 29, '08 09:12:16AM

I guess I agree with you. But you can argue the other way as well. The poster was used to having the "safety" of the normal Finder delete operation of moving things to the Trash. Not having "safety" in the UNIX equivalent was frustrating to him. So he makes the system consistent by adding extra safety to 'rm'. It creates a more uniform experience for the poster.

[ Reply to This | # ]
Do not make replacement versions or aliases for common programs
Authored by: marbx on Feb 29, '08 11:48:01AM

For people who use several computers on a daily basis, this might be a problem. Garumph makes the same point - if you use this function often, it may be easy to forget this is something that you had to add on (kind of like Quicksilver, I think). I disagree that aliasing in protection is always a bad idea, though. For example, every time I get an account on a Solaris box, the first thing I add to my profile is:

alias killall 'echo Do not use killall on Solaris unless you really mean it\!'

It's just a handy reminder, since I don't use Solaris often enough to remember that killall works differently on Solaris.

I guess I've got two real replies to this: One, this is just an extra safety measure. I still never trash anything (or rm it) until I'm sure I don't want it anymore. When you delete something, you should consider it deleted. But it's still nice to be able to drag something back out of the trash when you need to, whether you deleted it from the Finder or from a shell prompt. Of course, if you know you're going to forget that this doesn't work on every box you work on, don't use it. But for the rest of us, it may come in handy from time to time.

Two, there's nothing stopping you from putting this in the profile on every machine you use. Well, there may (for example) be a policy against editing profiles on company servers, I suppose. But both this function and the .Trash directory are kept in your home directory. I see no reason you can't go ahead and put this on multiple machines, whether running HP-UX, Solaris, IRIX, or what have you. Of course, you'd want to have a tcsh or ksh version, unless you've upgraded to bash on all those. ;)

[ Reply to This | # ]