Hi, I am getting stuck on the following step ’ Now, your function will print one thing if you pass it any argument, and something else if not. In the until loop, add again as an argument to where you call the function.’ of the Fortune program. My program seems to work well however it is not letting me pass this step?
#!/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 ))
function GET_FORTUNE() {
if [[ ! $1 ]]
then
echo Ask a yes or no question:
else
echo Try again. Make sure it ends with a question mark:
fi
read QUESTION
until [[ $QUESTION =~ \?$ ]]
do
GET_FORTUNE again
done
}
GET_FORTUNE
echo ${RESPONSES[$N]}
Please open your own topic. This one has been marked as solved already a while ago.
Delete echo $NUMBER above the if statement


