The -ge operator is one of Bash's numeric comparison primitives. When used inside [ ] or [[ ]], it treats both operands as integers and evaluates to true if-and only if-the value of the left-hand operand is greater than or equal to the right-hand operand. Therefore, in the script, the message is printed whenever the integer stored in usage is 80 or higher. The operator is not limited to strictly greater-than logic, does not perform lexicographic (string) comparison, and does not require floating-point values-in fact, it will raise an error if either operand is non-numeric or contains a decimal point.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What are other numeric comparison operators in Bash?
Open an interactive chat with Bash
What happens if non-numeric values are used with `-ge`?
Open an interactive chat with Bash
How does `tr -d '%'` help in the script?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Automation, Orchestration, and Scripting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .