[ "$VAR" = "" ] should be [ ! -n "$VAR" ] Refs #42