At first, I wrote some simple modules for command line parsing and locking, but then I tried to see how far I could push the poor shell. I wrote modules for semaphores and "thread"-safe queues, and this is where things quickly started to escalate. To implement a distributed build system that automates packaging/signing/publishing of toolbox Debian packages, I wrote a module for message-based IPC that supports point-to-point and pub-sub communication. Performance was never a consideration, but it works really well without consuming excessive resources.
Some of the modules are arguably serious abuse of the shell, but I found that toolbox makes it possible to write Bash scripts that are readable, testable, and reliable. Shell isn't a terribly nice language, but it's great for integrating and automating things, so I thought others might find this useful, too.
(I am going to publish the build system as well, as soon as I am done writing the documentation.)
Show HN: Toolbox – A framework for modular Bash scripts
m10k.eu