arg1 -le arg2 (conditional operator)

true if integer arg1 is less than or equal to integer arg2.

Examples

Different ways to compare two integers:
1
2
3
4
test "$n" -le 42 && echo "$n <= 42"
[ "$n" -le 42 ] && echo "$n <= 42"
# Bash
[[ "$n" -le 42 ]] && echo "$n <= 42"
BashSupport Pro is a Bash IDE with support for -letry it now!
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal