Defensive BASH Programming
Nov 14th, 2012 | Comments
Here is my Katas for creating BASH programs that work. Nothing is new here, but from my experience pepole like to abuse BASH, forget computer science and create a Big ball of mud from their programs.
Here I provide methods to defend your programs from braking, and keep the code tidy and clean.
Immutable global variables
Try to keep globals to minimum
UPPER_CASE naming
readonly decleration
Use globals to replace cryptic $0, $1, etc.
Globals I allways use in my programs: