Learn Bash Scripting by Building Five Programs

I’m stuck on this step where you have to call your GET_FORTUNE function. I’ve checked my code multiple times but it keeps giving the error “Your script should call the suggested function correctly”

I’m not sure how to get past this and have been stuck on this step for an hour now.

here’s the screenshot of the task:

and here’s my script:


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 ))


echo Ask a yes or no question:



echo ${RESPONSES[$N]}