I started working for a new group around mid-September and inherited an old (5 years or so) shell-script build system. Most of it is in KSH (I really prefer BASH) but alot of it is so poorly written and thought out that I have a hell of a time trying to fix/enhance it. Every time I need to do something to the scripts I oscillate for an hour on whether I should try to work my change into the existing script or just take the time to re-write the whole thing!
I was Googling today for some thoughts about writing shell scripts and found a great article about writing robust bash shell scripts. While I don't use everything mentioned in the article, I was happily surprised to find that I do use more than a couple of them.
Of course, one reason for my irritation with the system I've inherited is that it doesn't use any. Before working in this group, all SCM infrastructure I'd done was built ground up by myself. I feel for those poor developers that get stuck trying to enhance old code now that I've really gotten a taste of how hard it can be. I imagine there is alot more nasty build system scripts out there than there are good ones but I'll certainly try to even the odds a bit by making my scripts as robust, readable and commented as possible.
Hopefully someone who comes three or four years after I'm one will be pleasantly surprised when they have to add something to my scripts!
Tuesday, January 23. 2007
Robust Shell Scripting
Trackbacks
Trackback specific URI for this entry
No Trackbacks



