Tell us what’s happening:
I’ve written the code. Then deleted my code and started over again using the same CodeRoad instructions. Then I copied and pasted the hint solution for the if statement exactly as they have it written. I still keep getting the error stating that: “YOUR SCRIPT SHOULD HAVE THE SUGGESTED “IF” STATEMENT ADDED CORRECTLY”
I don’t see what my problem is. The code seems to be working properly as below is my output after the echo text was triggered in my if statement:
~~ Bingo Number Generator ~~
57
codeally@95a644544a4b:~/project$ ./bingo.sh~~ Bingo Number Generator ~~
5
The next number is, B:5
codeally@95a644544a4b:~/project$
Your code so far
#!/bin/bash
Bingo Number Generator
echo -e “\n~~ Bingo Number Generator ~~\n”
NUMBER=$(( RANDOM % 75 + 1 ))
TEXT="The next number is, "
echo $NUMBER
if (( NUMBER <= 15 ))
then
echo $TEXT B:$NUMBER
fi
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36
Challenge: Learn Bash Scripting by Building Five Programs - Build Five Programs
Link to the challenge: