bash - Shell equality operators (=, ==, -eq) - Stack Overflow
https://stackoverflow.com/questions/20449543/shell-equality-operators-eq
WEB4 Answers. Sorted by: 474. = and == are for string comparisons. -eq is for numeric comparisons. -eq is in the same family as -lt, -le, -gt, -ge, and -ne. == is specific to bash (not present in sh (Bourne shell), ...). Using POSIX = is preferred for compatibility. In bash the two are equivalent, and in sh = is the only one that will work. $ a=foo.
DA: 8 PA: 83 MOZ Rank: 80