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


Click here to return to the 'Not a good idea' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Not a good idea
Authored by: googoo on Feb 29, '08 08:28:42AM

In general, it is not a good idea to redefine basic commands like rm. You can run into problems with scripts and such that use the command. A better option would be to give your script another name (like the old rmm script) to avoid these conflicts.

-Mark



[ Reply to This | # ]
Yes and no
Authored by: SeanAhern on Feb 29, '08 09:09:32AM

If you created a shell script that did this, and put it somewhere in your $PATH, I'd agree with you. But this guy did it as a shell function. This means that it only takes effect in bash shells. And if he loads functions correctly, then it would only take effect in login bash shells. This restricts it to only interactive use, exactly what you want. It no longer affects scripts and other tools.



[ Reply to This | # ]