Tell us what’s happening:
I am almost 80% and the instructions say "The until loop is very similar to the while loop you used. It will execute the loop until a condition is met. Here’s an example:
until [[ CONDITION ]]
do
STATEMENTS
done
Add an until loop below your function. Use the double brackets to check if QUESTION is equal to test?. Move the GET_FORTUNE function call to the statements area of the loop. It should run the function until you input test? as the question."
I did the code but it didn’t work!
then I tryed looking in the hints but the hints said my code was right i don’t know what to do pls help
my code so far
#!/bin/bash
#Program to tell a persons fortune
echo -e “\n~~ Fortune Teller ~~\n”
RESPONSES=(“Yes” “No” “Maybe” “Outlook good” “Don’t count on it” “Ask again later”)
N=$((RANDOM % 6))
GET_FORTUNE() {
echo Ask a yes or no question:
}
until [[ $QUESTION == test? ]]
do
GET_FORTUNE
done
QUESTION=
read QUESTION
echo ${RESPONSES[$N]}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0
Challenge Information:
Learn Bash Scripting by Building Five Programs - Build Five Programs