|
What's with the five-level shell scripts? |
|
|
|
|
Written by W. Curtis Preston
|
|
Tuesday, 27 March 2007 |
|
I keep running into people that want to program their shell/perl scripts so that they source other scripts. Then those scripts call other scripts, and those scripts call other scripts.
At a recent client, we were trying to make sense of their database backup script. The main script called several other scripts, and those scripts called other scripts, and so on. It took hours of looking at way too many different scripts to figure out what was going on. I understand reuse of code, but what's wrong with functions? At most I can see one giant script that contains common code that gets sourced by other backup scripts. Or MAYBE several scripts all in one directory that get sourced by other scripts. Multi-level sourcing, however, is just mean. ;) Hey, I'm a consultant and I love the billable hours. Just trying to save you some time. Can anyone tell me why this is a good idea?
|