By the way, personally, I'm not huge on the "if" and "then" on separate lines. I prefer "if [ foo ]; then" on one line, but that may be a matter of taste. Saves some vertical screen estate ;-)