Lessons on testing bash scripts

As people at work know, I’m very driven towards automated testing of software. For me, this is a no-brainer but of course within certain limits.

However, testing bash scripts remains problematic. I will share some of the techniques I use to pull this off.

Keep Reading

Problems with errexit in bash

When I create a bash script, I want it to be robust. For a long time, the errexit option is used in a lot of my scripts. It makes the code a lot easier to read and maintain.

A while back, I was creating a script for checks that I wanted to run on the system. During writing test cases for this script, I hit a strange problem. All of the sudden, it seemed that the errexit didn’t work anymore. I could reproduce the problem fatefully.

Keep Reading

Getting drenched

Phew. Yesterday was a long day at work. I started at 8 and wrapped up a little after 9. But the most “exciting” part of the day was going back after dinner in a pre monsoon shower.

Keep Reading