Or, the one in which we hand-craft nano Unix tools using Bash functions.
As we saw in the previous post, functions obey stdio and we can mix and match them with built-ins (grep, sed, cat etc.) and other installed tools (like jq, pandoc, babashka etc.). We used functions to name parts of Douglas McIlroy’s pipeline and mess around a bit.
I tend to make libraries of pure functions that I can source in shell sessions and use just like any other shell tool, complete with tab-completion. e.g. bash-toolkit and shite.
Now we step back and try to build good intuitions about
- what functions are
- how to design good functions
- how to design programs with functions
- how to name them :)