So is this a bug?! Or a hack?
It's a programming mistake
. Or a bad call
by a script coder. Period.
There's nothing intrinsically wrong with rm -rf/
. It's just one more command. The same as rd /s/Q
in Windows. It can be a handy way of cleaning out a lot of unneeded directories and files provided you know (a) exactly what
you want to accomplish; and (b) exactly how
the command actually works.
In this case, not having the '$STEAMROOT' directory where it was expected to be was the same as invoking the command with a wildcard. So instead of purging a specific directory, having a null value for $STEAMROOT meant the shell interpreter blew past it and went straight to / as its next valid criteria. Booyah! And blammo
I'm amazed whoever put that command in a script didn't realize that could happen. Especially since rm -rf/*
is one of the first "killer commands
Linux users learn and repeatedly get warned about. My guess is that whoever did this is probably a Windows programmer by trade. Windows has some built-in safeguards when you run the rd
command. That, however, is not the case in Linux, which assumes you know what you're doing when issuing commands within a terminal session.