← Back to context

Comment by tgbugs

4 years ago

Word of warning from hard experience: rn is a really dangerous thing to name a function because it is one char away from rm.

One char away also physically on the keyboard (maybe that's what you meant?).

  • I once ran “crontab -r” instead of “crontab -e” and also thought that was terrible design for the same reason.

Looks like it's typically run without any arguments, so it's probably fine.

  • A typo can go the other way, like "rn somefile" where it was meant to remove a file but instead it renames all files.

Agree. Having this function exit if any arguments are passed to it seems like a good safety measure.