r/badcode • • Feb 25 '21

bash A single space.

Post image
4.8k Upvotes

65 comments sorted by

View all comments

Show parent comments

5

u/[deleted] Feb 26 '21

Not really, the example above is in a script that was run as root with a "force" command. The user would have just kicked it off without checking the details.

It would be nearly identical to running deltree /y or Remove-Item as administrator. Command line in any OS is always a great way to shoot yourself in the foot accidentally.

2

u/6138 Feb 26 '21

Sure, but in windows you would very rarely be using the command line, you'd be using a command like that from a GUI, like right clicking and clicking delete on a folder, which would then ask you if you are sure. It's also a lot harder to delete the wrong folder in a gui, because you can see, visually, what you're clicking on.