Show HN: Toolbox – A framework for modular Bash scripts(m10k.eu)
m10k.eu
Show HN: Toolbox – A framework for modular Bash scripts
https://m10k.eu/toolbox.html
2 comments
That's awesome! Looks like you've been working on it for some time too: https://github.com/m10k/toolbox
You should put in a README on Github some how-to and explain what "modules" are available for inclusion and how they work!
You should put in a README on Github some how-to and explain what "modules" are available for inclusion and how they work!
Thanks! I didn't realize it's been almost a year already.
I decided very recently to publish this project on Github and write about it here, so documentation has not been a top priority. While writing about it, I realized that documentation will crucial though, so it is at the top of my list now (I was even pondering whether I should postpone posting on HN until the documentation is done).
I decided very recently to publish this project on Github and write about it here, so documentation has not been a top priority. While writing about it, I realized that documentation will crucial though, so it is at the top of my list now (I was even pondering whether I should postpone posting on HN until the documentation is done).
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.)