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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: How does one practice day to day shell scripting

2 点作者 mindentropy超过 1 年前
As a developer my job does not involve day to day shell scripting. It comes up occasionally and due to this I face a problem now where I forget the syntax and will have to look it up again which takes a long time. I want to improve on this and would like to be fluent and for this I need to script on a regular basis.<p>I would like to know how people of HN keep in touch with scripting on a regular basis as a part of your job and what are the practices that you follow.

3 条评论

dxs超过 1 年前
I&#x27;d say check out the work of William Shotts at <a href="https:&#x2F;&#x2F;linuxcommand.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;linuxcommand.org&#x2F;</a> His book, &quot;The Linux Command Line&quot; is free for downloading, and there are lots of references to style guides, good practices, and bash templates in the book.<p>There is also a shorter, HTML version at the same site: <a href="https:&#x2F;&#x2F;linuxcommand.org&#x2F;lc3_learning_the_shell.php" rel="nofollow noreferrer">https:&#x2F;&#x2F;linuxcommand.org&#x2F;lc3_learning_the_shell.php</a><p>I&#x27;m trying to get a little proficiency in all this, and just yesterday I went through the &quot;Further Reading&quot; sections at the end of each chapter, and captured all the likely URLs for further investigation.<p>One that looks really good is Dylan Araps&#x27; &quot;Pure Bash Bible&quot; ( See <a href="https:&#x2F;&#x2F;github.com&#x2F;dylanaraps&#x2F;pure-bash-bible">https:&#x2F;&#x2F;github.com&#x2F;dylanaraps&#x2F;pure-bash-bible</a> ) Confession: I found a PDF copy at Libgen, but don&#x27;t tell anyone. This and the Shotts book have also been thoroughly discussed on Hacker News in the past. (I.e., search on the two titles and you&#x27;ll probably get all the opinions that you can stand, plus maybe some more hints.)<p>Bash is profoundly weird, but if&#x2F;when you can make it work, it&#x27;s slick.
dxs超过 1 年前
I forgot to mention &quot;shellcheck&quot; at <a href="https:&#x2F;&#x2F;www.shellcheck.net&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.shellcheck.net&#x2F;</a> and the explanation of its error codes at <a href="https:&#x2F;&#x2F;www.shellcheck.net&#x2F;wiki&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.shellcheck.net&#x2F;wiki&#x2F;</a><p>This is also referenced by Shotts, and has been discussed on Hacker News -- not to be missed.
fiedzia超过 1 年前
Don&#x27;t. My rule is if it&#x27;s more then 3 lines or more complex than simple commmand call, it&#x27;ll be written in Python. It will be easier to read for everyone around and avoid all the shell footguns.
评论 #37626828 未加载