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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Show HN: A Go package to execute shell commands in specified order

3 点作者 amalfra将近 8 年前

2 条评论

noasiwiwiwu将近 8 年前
Hi<p>Your software is broken by assuming a command can be split up into arguments by spaces, and also not letting the os package properly escape your arguments.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;amalfra&#x2F;oexec&#x2F;blob&#x2F;master&#x2F;oexec.go#L48" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;amalfra&#x2F;oexec&#x2F;blob&#x2F;master&#x2F;oexec.go#L48</a><p>Here&#x27;s a command that would be impossible to execute with your software, notice how the last argument is a single argument:<p><pre><code> c := exec.Command( &quot;&#x2F;usr&#x2F;bin&#x2F;osascript&quot;, &quot;-e&quot;, &quot;say 5&quot;) output, err := c.CombinedOutput()</code></pre>
评论 #15061359 未加载
sigmonsays将近 8 年前
Came by to mention the broken design...