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

Click here to return to the '"What about on a personal system?"' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
"What about on a personal system?"
Authored by: pediddle on Mar 01, '08 08:54:10AM

Like garumph said -- the fallout for other scripts could still be disastrous. First of all, rm has many behaviors that differ slightly from just deleting files.

rm -R # recursive
rm -i # interactive
rm -f # forceful
rm -d # remove directories
rm -P # overwrite files ("secure")

Does this script obey ANY of these options? (And those are just the BSD options -- forget about it if you install the GNU version from DarwinPorts.) Any script that relies on these could fail disasterously, and WORSE, it could accidentally destroy your system.

Second, the low-level meaning of moving a file differs slightly from unlinking an inode (no, I don't understand exactly how it works). This could screw up anything that relies on that difference, too -- probably in subtle ways that could slowly corrupt your system over time.

Third, if you ever delete anything from another volume, the script actually COPIES files to ~/.Trash (and then deletes the originals) rather than moving them to the volume's own trash. Forget about it if you're trying to delete a "special" file (/dev/* entry, named FIFO, etc.).

Fourth, there are almost certainly other unintentional consequences that we haven't even considered. There always are. That's how software works (or more often doesn't, when you pull stupid stunts like this).

Any modern system is NEVER just a "personal" system. There are thousands of scripts running that are written by OTHER people. These other people are essentially using your computer every day.

[ Reply to This | # ]