Tell us what’s happening:
this test is not passing
instruction:
after Add commands to run the rest of your scripts in the file. They should be in this order: questionnaire, countdown, bingo, and fortune. Don’t forget that your countdown.sh file needs an argument, so put a 3 next to it.
here is a picture of what is failing with the error:
//five.sh
#!/bin/bash
# Program to run my other four programs
./questionnaire.sh
./countdown.sh 3
./bingo.sh
./fortune.sh
//bingo.sh
#!/bin/bash
# Bingo Number Generator
echo -e "\n~~ Bingo Number Generator ~~\n"
NUMBER=$(( RANDOM % 75 +1 ))
TEXT="The next number is, "
if (( $NUMBER <= 15 ))
then
echo $TEXT B:$NUMBER
elif [[ $NUMBER -le 30 ]]
then
echo $TEXT I:$NUMBER
elif (( $NUMBER < 46 ))
then
echo $TEXT N:$NUMBER
elif [[ $NUMBER -lt 61 ]]
then
echo $TEXT G:$NUMBER
else
echo $TEXT O:$NUMBER
fi
//countdown.sh
#!/bin/bash
# Program that counts down to zero from a given argument
echo -e "\n~~ Countdown Timer ~~\n"
if [[ $1 -ge 0 ]]
then
: ' for (( i = $1; i >= 0; i--))
do
echo $i
sleep 1
done '
I=$1
while [[ $I -ge 0 ]]
do
echo $I
(( I-- ))
sleep 1
done
else
echo Include a positive integer as the first argument.
fi
//fortune.sh
#!/bin/bash
# Program to tell a person's fortune
echo -e "\n~~ Fortune Teller ~~\n"
RESPONSES=("Yes" "No" "Maybe" "Outlook good" "Don't count on it" "Ask again later")
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
}
GET_FORTUNE
until [[ $QUESTION =~ \?$ ]]; do
GET_FORTUNE again
done
N=$(( RANDOM % 6 ))
echo -e "\n${RESPONSES[$N]}"
questionnaire.sh
#!/bin/bash
echo -e "\n~~ Questionnaire ~~\n"
QUESTION1="What's your name?"
echo $QUESTION1
read NAME
echo Hello $NAME.
QUESTION2="Where are you from?"
echo $QUESTION2
read LOCATION
echo Hello $NAME from $LOCATION.
QUESTION3="What's your favorite coding website?"
echo $QUESTION3
read WEBSITE
echo -e "\nHello $NAME from $LOCATION. I learned that your favorite coding website is $WEBSITE!"
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
Challenge Information:
Build Five Programs - Build Five Programs



