[CentOS] In A UEFI World, "rm -rf /" Can Brick Your System

Mon Feb 1 19:54:57 UTC 2016
Frank Cox <theatre at melvilletheatre.com>

On Mon, 1 Feb 2016 13:44:48 -0600
Chris Adams wrote:

> Did someone think running "rm -rf /" is a good idea?

Quote from one of the people who commented on that article:


You have this in a script: rm -rf "${DIRECTORY}"/

Now, you have a bug in the script and ${DIRECTORY} is not initialized. You then get rm -rf / executed. One should always ensure that DIRECTORY is not empty before running this. Or better, never end with /. If you have rm -rf "${DIRECTORY}", then only rm -rf gets executed, causing rm to fail since no file/directory is provided.

MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com