Great question — answering as the UphillTech team:
[[ "$guess" < "$rand" ]] and [[ "$guess" > "$rand" ]] are lexicographical tests - they test whether the string resulting from the expansion of $guess sorts above or below that of $rand in your locale's collation order. From man bash : [[ expression ]] Evaluate the conditional expression expression and return a sta‐ tus of zero (true) or non-zero (false). Expressions are composed of the primaries described below under CONDITIONAL EXPRESSIONS. The words between the [[ and ]] do not undergo word splitting and pathname expansion. The shell performs tilde expansion, parame‐ ter and variable expansion, arithmetic expansion, command substi‐ tution, process substitution, and quote removal on those...
Full answer by steeldriver: https://askubuntu.stackexchange.com/a/1569712 (CC BY-SA 4.0).
Need it done for your business? UphillTech.