Learn Bash Scripting by Building Five Programs - Build Five Programs

Tell us what’s happening:
I am doing learn Learn Bash Scripting by Building Five Programs until exercise:

You used the double square brackets with your if statement in the last program, but you can use the double parenthesis with these operators as well. In your script, create an if statement that uses double parenthesis for the condition. Check if the number variable is less than or equal to 15. If it is, use your two variables to print The next number is, B:<number> .

I try add to if statements below does not complete. It was error: Your script should have the suggested “if” statement added correctly

My source code:

#!/bin/bash

# Bingo Number Generator
echo -e "\n~~ Bingo Number Generator ~~\n"
NUMBER=$(( RANDOM % 75 + 1 ))
echo $NUMBER
TEXT="The next number is, B:<number>"

if (( NUMBER <= 15 ))
then
  echo $TEXT B:$NUMBER
fi

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36

Challenge: Learn Bash Scripting by Building Five Programs - Build Five Programs

Link to the challenge:

Please help me to solve this error. Thank you so much.

should NUMBER be $NUMBER?

1 Like

I fixed. Thank you so much!

1 Like