Complete the code to check if the variable 'num' is equal to 10.
if [ $num [1] 10 ]; then echo "Number is ten" fi
In bash, to compare integers, use -eq inside the test brackets.
Complete the code to add an elif branch that checks if 'num' is greater than 10.
if [ $num -eq 10 ]; then echo "Number is ten" elif [ $num [1] 10 ]; then echo "Number is greater than ten" fi
The operator -gt means 'greater than' for integers in bash.
Fix the error in the else branch syntax.
if [ $num -eq 10 ]; then echo "Number is ten" elif [ $num -gt 10 ]; then echo "Number is greater than ten" [1] echo "Number is less than ten" fi
The else branch starts with the keyword else without any condition.
Fill both blanks to correctly compare a string variable 'color' with 'red' and 'blue'.
if [ "$color" [1] "red" ]; then echo "Color is red" elif [ "$color" [2] "blue" ]; then echo "Color is blue" else echo "Color is something else" fi
For string comparison in bash, = and == are valid inside [ ].
Fill all three blanks to create a nested if-elif-else that checks if 'score' is above 90, above 75, or else.
if [ $score [1] 90 ]; then echo "Grade A" elif [ $score [2] 75 ]; then echo "Grade B" [3] echo "Grade C" fi
Use -gt for 'greater than', -ge for 'greater or equal', and else for the fallback case.
