bash

Limitations of Comparisons in Bash

Shou Arisaka
1 min read
Oct 23, 2025

You cannot use <,>,<=,>= in conditional expressions. Instead, you can use -lt(<),-gt(>),-le(<=),-ge(>=). Remember them as -lt(less than),-gt(greater than),-le(less than or equal),-ge(greater than or equal) respectively.

Example:

if [ 50 -gt 60 ]
then
fi

Share this article

Shou Arisaka Oct 23, 2025

๐Ÿ”— Copy Links