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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: A Bash guide for Posix shell programmers?

19 点作者 tschumacher超过 1 年前
I've been programming POSIX shell for a while and know pretty much all of it (the spec isn't that long: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html). I mostly stayed away from Bash because of the "it runs everywhere" promise of POSIX but recently I've realized that most of the scripts I write will probably always run on machines with Bash installed anyways. I'm looking for a guide that explains Bash features specifically and doesn't go over the whole shell programming basics again. I know some features here and there, e.g. I know that Bash has arrays and a syntax to redirect the contents of a variable to a file, but I'm looking for a comprehensive list of what's possible. Are there any resources you can recommend?

6 条评论

tschumacher超过 1 年前
It turns out the Bash manual groups the Bash specific features into its own chapter [1] and it&#x27;s a short read and also there are not nearly as many Bash specific features as I thought.<p>[1] <a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;bash&#x2F;manual&#x2F;bash.html#Bash-Features" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.gnu.org&#x2F;software&#x2F;bash&#x2F;manual&#x2F;bash.html#Bash-Feat...</a>
dharmab超过 1 年前
The three most important resources I&#x27;ve used:<p>- <a href="https:&#x2F;&#x2F;tldp.org&#x2F;LDP&#x2F;abs&#x2F;html&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;tldp.org&#x2F;LDP&#x2F;abs&#x2F;html&#x2F;</a><p>- <a href="https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashGuide" rel="nofollow noreferrer">https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashGuide</a><p>- <a href="https:&#x2F;&#x2F;www.shellcheck.net&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.shellcheck.net&#x2F;</a> (can tell you if there&#x27;s a Bash-specific replacement for a POSIX mechanic)<p>I&#x27;ll be reading this book over the break: <a href="https:&#x2F;&#x2F;fabiensanglard.net&#x2F;bash&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;fabiensanglard.net&#x2F;bash&#x2F;</a>
评论 #38680571 未加载
评论 #38678737 未加载
runjake超过 1 年前
This may not explicitly meet your requirements, but I always find this site handy for quick reference:<p><a href="https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;docs&#x2F;bash&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;docs&#x2F;bash&#x2F;</a><p>It helpfully also links to the Bash manual:<p><a href="https:&#x2F;&#x2F;www.gnu.org&#x2F;savannah-checkouts&#x2F;gnu&#x2F;bash&#x2F;manual&#x2F;bash.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.gnu.org&#x2F;savannah-checkouts&#x2F;gnu&#x2F;bash&#x2F;manual&#x2F;bash....</a>
1vuio0pswjnm7超过 1 年前
Bash is slower. That&#x27;s why a major Linux distribution would switch to NetBSD Almquist sh. On a Linux distribution, generally, bash is always found in the userland. But for scripting (non-interactive use), it&#x27;s big and slow.
评论 #38680815 未加载
NukedOne超过 1 年前
You might find this useful:<p><a href="https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashGuide" rel="nofollow noreferrer">https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashGuide</a>
haltist超过 1 年前
Learn Bash the Hard Way by Ian Miell