logoalt Hacker News

MathMonkeyMantoday at 3:15 AM0 repliesview on HN

I regularly refer to [the unix shell specification][1] to remember the specifics of ${foo%%bar} versus ${foo#bar}, ${parameter:+word} versus ${parameter:-word}, and so on.

It also teaches how && and || work, their relation to [output redirection][3] and [command piping][2], [(...) versus {...}][4], and tricky parts like [word expansion][5], even a full grammar. It's not exciting reading, but it's mostly all there, and works on all POSIXy shells, e.g. sh, bash, ksh, dash, ash, zsh.

[1]: https://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html

[2]: https://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html...

[3]: https://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html...

[4]: https://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html...

[5]: https://pubs.opengroup.org/onlinepubs/7908799/xcu/chap2.html...