HACKER Q&A
📣 stikit

How do you build your Bash scripts? Do you use frameworks?


I use Bash scripts quite a bit for short term 'throw-away' type projects that may or may not be re-used once a project is over. These projects are mostly automating server and cloud environments. While each project may not be used again, I've organized the code into modules that I re-use between projects. I've considered re-writing to Python or even Node.js, but its hard to justify the investment of resources for the conversion given the flexibility and ubiquity of Bash.

I've grown to really like Bash as I can do things in one line using builtins vs a multiple line Python script requiring external libraries. I can also have exact parity with cloud command line interface ( e.g. aws, az, gcloud) features (vs the cloud API libraries).

Assuming I stick with Bash for at least the short term, what Bash frameworks have you used and recommend? I've taken a look at Bash infinity but it doesn't appear be an active project judging by lack of recent releases. I'm primarily interested in code-reuse and best practices. I'm already well on my way to building a framework with a node feel, incorporating shellcheck, creating an 'app generator' and pulling in modules from an external privately shared repository.

Am I re-inventing the wheel? Does anyone else have any use for something similar?


  👤 verdverm Accepted Answer ✓
I've recently been using python scripts and bash now feels like a big hack over having a real programming language.