Automation, Orchestration, and Scripting
A monitoring script stores a whole-number disk usage percentage in the variable usage. The script must take the alert branch when usage is 90 or higher. Which TWO tests do this correctly in Bash? (Choose two.)
Choose 2 answers
Show the answer
Correct answersC. [ "$usage" -ge 90 ]F. [ "$usage" -gt 89 ]
The -ge and -gt operators compare integers, so -ge 90 and -gt 89 both match any whole number of 90 or more. The > operator is a string comparison, so 100 sorts before 89 and the test gives wrong results; inside single brackets it is a redirection instead.