Learn Bash Scripting by Building Five Programs


I’m working on “Build Five Programs” but can’t seem to get past the CodeAlly “Redirecting back to origin site” step. I haven’t had any problems with the first three courses. Any ideas how to get past this?

I need some help.

I think that my code its ok. I can run the bingo.sh without any problem ./bingo.sh
but can go forward cause it says “Your script should have the suggested “if” statement added correctly”

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

what can i do?

Hi. Can someone help me? Whenever I click start course on Bash Scripting, I always get stuck on this screen.

1 Like

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]}
1 Like

Please open your own topic. This one has been marked as solved already a while ago.

Delete echo $NUMBER above the if statement