Sunday, April 10, 2005

TDD Bash scripting

I've decided to finally start writing some scripts for the mundane tasks that I seem to have to perform from time to time. I really haven't written many Bash scripts, though I've been hanging out on Linux for more than 10 years now. But I'm sick of the time wasted on a few tasks recently, so its time to do something about the lack of scripting.

Now, I'm not exactly doing TDD as such. I'm not writing any automated tests. But I am approaching the script writing as if I were. I've taken a specific task and scripted it. Made sure that it performs in the way I expect it to. Then I've refined it. Makes this all too easy. The script is barely a screenful with comments, so I'm not fussed about the lack of testing. If it were more, I'd be getting a bad feeling in my gut, I'm sure.

So now I can type one command and save time and effort. The script smells a little bit, but I can live with the smell for the time being (at least until my knowledge of Bash improves, which may be never...).

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home