Mildly amusing shell script story today. I share my office space with two co-workers, one who (like me) is partial to tcsh and the other is a bash fan. A particular development task they share only works in the tcsh person's environment, and the bash person is trying to get it to work in his. "But it worked yesterday, I don't understand...", etc. This went on for around 90 minutes, as the possible causes were investigated back-n-forth, spinning out of control. Any programmer will recognize this situation, the solution is usually right under your nose--or (0.01% of the time) is wildly obscure.
Finally I can take it no longer and have to throw my two cents in. I ask about two common mistakes, and both tell me no, those are the first things they checked (of course).
I ask if $variable is set, and of course, they checked it too (now this is definitely the closest possible cause). See, the bash person says, showing an echo $variable statement. Well let me try some things, I say, reaching for the keyboard. For some reason, I want to do env | grep variable first, even though it should be the equivilant of echo $variable. So I do, and boom--$variable isn't set. Aha--there is a difference in bash between set variable and export variable, so it's immediately obvious that he must have done set instead of export. Only export propogates $variable to sub-shells... so I got to look smart, only if I hadn't felt like doing env | grep, I'd probably have been spinning wheels for an hour as well.