Lately I’ve had the chance to dive much deeper into BASH than I ever have before. I’m working on a build system with a dozen or so library files, and as many client scripts for the actual builds. A big question is whether or not BASH is the best language for the system compared to scripting options like Python, Perl, Ruby, PHP >cough<, etc. Initially I wrote the entire build system in BASH. But given an opportunity to learn Python, and put the theory to the test, I decided to start implementing some of the components in Python to see what it could offer.
I have an Apple laptop. Not because I’m obsessed with Apple like a lot of folks out there, but because I think Apple laptops are the least of all evils as laptops go. It’s Unix-ish, and I don’t have to think about problems supporting hardware like the old days when I ran Linux on my laptops. That said, there are plenty of things that bother me about the ‘Most advanced operating system on the planet’. One of my biggest gripes is the lack of sensitivity out of the box.
You may remember my recent article about running commands across a number of hosts with SSH and BASH. Then there was my second review of Fabric, where I mention my ‘dream’ to write a similar system in BASH some day. I’m slowly getting better with BASH and recently I’ve been working on mastering redirection and sub-shells. Well I’ve got another nice parlor trick to share with you!
Lately I’ve been writing my fair share of BASH, and slowly becoming proficient with it. I wanted to share my version of implementing a common design pattern from the Object Oriented world in BASH. Namely, the template method design pattern.
I’ve been using Fabric for a couple of months now. Before that I took a quick look at Capistrano. Sometimes I have a simple task I want to do on a few servers, and I don’t feel like touching either one of them. We’re talking about those times where you’d almost rather login to every box and run the commands by hand. Good news is before there was Python or Ruby, there was BASH!