As I understand it
= expects strings
-eq expects integers
"$bar" is for literal matches, i.e. z* may expand but "z*" will literally match the wildcard char.
The difference between [] and [[]] is that in the latter word splitting and path name expansion are not done, but are in the former.
Plus [[]] allows the additional operators :
&& (AND),
|| (OR),
> (String1 lexically greater than String2),
< (String1 lexically less than String2)
The == comparison operator behaves differently within a double-brackets test than within single brackets.
[[ $a == z* ]] # True if $a starts with an "z" (pattern matching).
[[ $a == "z*" ]] # True if $a is equal to z* (literal matching).
[ $a == z* ] # File globbing and word splitting take place.
[ "$a" == "z*" ] # True if $a is equal to z* (literal matching).
Check out http://tldp.org/LDP/abs/html/comparison-ops.html for more info