arg1 -ge arg2 (conditional operator)
Arithmetic comparison: true
if integer arg1
is greater than or equal to integer arg2
.
Links
Examples
- Different ways to compare two integers:
1 2 3 4
test "$n" -ge 42 && echo "$n >= 42" [ "$n" -ge 42 ] && echo "$n >= 42" # Bash [[ "$n" -ge 42 ]] && echo "$n >= 42"
BashSupport Pro 是一个 支持 -ge 的 Bash 集成开发工具 – 马上试用!