Re: In A UEFI World, "rm -rf /" Can Brick Your System

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 02/01/2016 11:54 AM, Frank Cox wrote:
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:

QUOTE:

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.
END OF QUOTE


Yeah, that can happen, but I remember being taught that was an extremely bad scripting practice back in 1998 when I took my first Linux class.
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux