Complete the code to check if the variable num is equal to 5.
if [ "$num" [1] 5 ]; then echo "Number is five" fi
In bash, to compare integers inside [ ], use -eq for equality.
Complete the code to check if the file myfile.txt exists.
if [1] myfile.txt; then echo "File exists" fi
-d which checks only directories.-s which checks if file is not empty.test -e checks if a file or directory exists.
Fix the error in the if statement to correctly check if count is greater than 10.
if [ $count [1] 10 ]; then echo "Count is large" fi
For numeric comparisons in bash, use -gt for 'greater than'.
Fill both blanks to check if the variable word is not empty and equals "hello".
if [ -n [1] ] && [ [2] = "hello" ]; then echo "Greeting detected" fi
-z which checks for empty string.-n $word checks if word is not empty, and $word = "hello" checks string equality.
Fill all three blanks to check if num is between 1 and 10 inclusive.
if [ [1] -ge 1 ] && [ [2] [3] 10 ]; then echo "Number is between 1 and 10" fi
-lt instead of -le for the upper bound.Use $num -ge 1 to check greater or equal 1, and $num -le 10 to check less or equal 10.
