On Tuesday, 26 February 2013 at 07:08:37 UTC, Lars T. Kyllingstad
wrote:
What if the variable is set, but empty? Is that very different
from the situation where it doesn't exist at all? In my
opinion,
when it comes to environment variables, no.
Until today, I didn't know that empty variables could exist. They
don't exist on Windows: setting a variable to an empty string is
how you delete it.
Regardless, I think my point still stands on the argument that
it's much more likely for a variable to be unexpectedly unset
rather than unexpectedly empty. To extend to a general case, we
could say that an empty variable is as likely as any invalid or
unexpected value. For the 'rm -rf $FOO/$BAR' case, one can come
up with any combinations of FOO and BAR, such as "/bin" and
"../", where the command would have the same effect.