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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Practical Shell Patterns I Use

17 点作者 oedmarap超过 3 年前

3 条评论

marginalia_nu超过 3 年前
The last example<p><pre><code> $ kubectl apply -f &lt;(cat &lt;&lt; EOF … EOF ) </code></pre> can be written<p><pre><code> $ kubectl apply -f- &lt;&lt;EOF # ... </code></pre> Piping from cat is a pretty big red flag that you are doing whatever you are doing in a roundabout way.
评论 #29812582 未加载
tsujp超过 3 年前
There&#x27;s also these resources for more vetted patterns:<p>(1) Bash: <a href="https:&#x2F;&#x2F;github.com&#x2F;dylanaraps&#x2F;pure-bash-bible" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dylanaraps&#x2F;pure-bash-bible</a><p>(2) POSIX Shell: <a href="https:&#x2F;&#x2F;github.com&#x2F;dylanaraps&#x2F;pure-sh-bible" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dylanaraps&#x2F;pure-sh-bible</a>
oweiler超过 3 年前
For killing matching processes I prefer killall or pkill.<p>For infinite loops I prefer the slightly faster<p>while :; do # do sth done