TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Simple Bash syntax error in Steam for Linux executed “rm -rf /*” (2015)

31 点作者 jakejarvis大约 6 年前

3 条评论

smhenderson大约 6 年前
My first thought on reading the headline was &quot;what Linux still did that in 2015&quot;? I thought I read somewhere years ago that Sun, BSD and GNU rm all had checks in them to spot the &#x2F; or &#x2F;* and refuse to run. According to this SE page[1] GNU even has an option to tell rm &quot;no I really do want to blow away my whole root&quot; by using &quot;--no-preserve-root&quot;.<p>Apparently the &quot;fix&quot; only applies to the root user. The article is about a regular user who recursively lost everything he owned starting at &#x2F;.<p>Ouch!<p>[1] <a href="https:&#x2F;&#x2F;unix.stackexchange.com&#x2F;questions&#x2F;19547&#x2F;how-far-can-you-go-with-rm-rf-as-root" rel="nofollow">https:&#x2F;&#x2F;unix.stackexchange.com&#x2F;questions&#x2F;19547&#x2F;how-far-can-y...</a>
评论 #19627080 未加载
jimrandomh大约 6 年前
The real problem here is that a multi-hundred-line script was written in bash. While bugs can happen in any language, this particular error was due to a bash-specific pitfall, and bash has <i>many</i> such pitfalls. Bash is really only suitable for interactive use, or for bootstrapping the install of another scripting language.
评论 #19628477 未加载
MrMember大约 6 年前
&gt;Line 468: rm -rf &quot;$STEAMROOT&#x2F;&quot;*<p>Oh man, reading that line made me cringe.
评论 #19627047 未加载