452
rm -rf /usr due to typo (sh.itjust.works)
you are viewing a single comment's thread
view the rest of the comments
[-] SavvyBeardedFish@reddthat.com 148 points 2 days ago
[-] OwOarchist@pawb.social 136 points 2 days ago

rm -rf "$STEAMROOT/"* could be evaluated as rm -rf "/"* if $STEAMROOT is empty

Ah, good times.

[-] Fmstrat@lemmy.world 17 points 2 days ago

I love how someone committed # scary! above it rather than fixing it.

[-] victorz@lemmy.world 29 points 2 days ago

Probably a good idea to enable the nounset shell option when shipping commercial-grade install scripts. ๐Ÿ˜…

[-] fruitcantfly@programming.dev 7 points 2 days ago* (last edited 2 days ago)

That really ought to have been the default behavior. Opting out only takes one or two extra characters. Well, three or four if you don't habitually bracket your variable names, which you should probably be doing anyways

[-] OwOarchist@pawb.social 4 points 2 days ago

Or just include the trailing slash in $STEAMROOT, so that if the variable is empty, it will evaluate to rm -rf "" and do nothing.

[-] victorz@lemmy.world 8 points 2 days ago

That seems like a more error-prone solution than the shell option. That would make it evaluate to rm -rf * which would probably delete your home directory, I'm guessing. And also put the burden of knowing the slash needs to be included on something completely disconnected from the expression. Nah, don't do it like that.

[-] sp3ctr4l@lemmy.dbzer0.com 19 points 2 days ago

Wow.

That's a nuclear grade 'oopsie' right there hahaha!

[-] Cyber@feddit.uk 25 points 2 days ago

Jeez. Didn't hear about that one, back in the day.... wow.

this post was submitted on 24 Jul 2026
452 points (100.0% liked)

Programmer Humor

32472 readers
368 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS