TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

2 pointsby mindentropyover 1 year ago
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 comments

dxsover 1 year ago
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.
dxsover 1 year ago
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.
fiedziaover 1 year ago
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 未加载