-lt and -gt are numeric comparisons (less-than [and not equal], greater-than [and not equal]). … These are numeric operators, so there will be an error if either side isn’t a number, and 9 is considered less than 10 .
What is LT in Unix?
-lt. Checks if the value of left operand is less than the value of right operand; if yes, then the condition becomes true. [ $a -lt $b ] is true. -ge. Checks if the value of left operand is greater than or equal to the value of right operand; if yes, then the condition becomes true.
What is GT in Linux?
-gt means “greater than”. … The other relevant operators for comparing integers in the shell with test or in [ … ] are -ge (“greater-than or equal”), -lt (“less-than”), -le (“less-than or equal”), -eq (“equal”) and -ne (“not equal”).