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?
It turns out the Bash manual groups the Bash specific features into its own chapter [1] and it's a short read and also there are not nearly as many Bash specific features as I thought.<p>[1] <a href="https://www.gnu.org/software/bash/manual/bash.html#Bash-Features" rel="nofollow noreferrer">https://www.gnu.org/software/bash/manual/bash.html#Bash-Feat...</a>
The three most important resources I've used:<p>- <a href="https://tldp.org/LDP/abs/html/" rel="nofollow noreferrer">https://tldp.org/LDP/abs/html/</a><p>- <a href="https://mywiki.wooledge.org/BashGuide" rel="nofollow noreferrer">https://mywiki.wooledge.org/BashGuide</a><p>- <a href="https://www.shellcheck.net/" rel="nofollow noreferrer">https://www.shellcheck.net/</a> (can tell you if there's a Bash-specific replacement for a POSIX mechanic)<p>I'll be reading this book over the break: <a href="https://fabiensanglard.net/bash/" rel="nofollow noreferrer">https://fabiensanglard.net/bash/</a>
This may not explicitly meet your requirements, but I always find this site handy for quick reference:<p><a href="https://learnxinyminutes.com/docs/bash/" rel="nofollow noreferrer">https://learnxinyminutes.com/docs/bash/</a><p>It helpfully also links to the Bash manual:<p><a href="https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html" rel="nofollow noreferrer">https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash....</a>
Bash is slower. That'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's big and slow.
You might find this useful:<p><a href="https://mywiki.wooledge.org/BashGuide" rel="nofollow noreferrer">https://mywiki.wooledge.org/BashGuide</a>