Tell us what’s happening:
I did everything in a task but its not validating can someone verify i didn’t do an error
The error : Your script should “read” input into the suggested variable correctly
Tell us what’s happening:
I did everything in a task but its not validating can someone verify i didn’t do an error
that’s my code :
#!/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:
read QUESTION
}
GET_FORTUNE()
echo ${RESPONSES[$N]}
Your 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:
read QUESTION
}
GET_FORTUNE()
echo ${RESPONSES[$N]}
Challenge Information:
Learn Bash Scripting by Building Five Programs - Build Five Programs
This the instructions :
In your function after you print the sentence, use read
to get user input into a variable named QUESTION
.
[/quote]
Your 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:
read QUESTION
}
GET_FORTUNE()
echo ${RESPONSES[$N]}
Challenge Information:
Learn Bash Scripting by Building Five Programs - Build Five Programs
This the instructions :
In your function after you print the sentence, use read
to get user input into a variable named QUESTION
.