dountil() {
#Prompt user below to guess randomly-generated number between 1 and 10
(( answer = $RANDOM % 1-10 ))
until [[ $guess -eq answer ]]
do
read -p "Enter a number between 1 and 10:" guess
if [[ $guess -ne answer ]]; then
echo "Incorrect. Try again"
elif [[ $guess -eq answer ]]; then
echo "Correct! Want to play again?"
read -p prompt
if [[ $prompt = yes ]]
dountil
if [[ $prompt = no ]]
then
echo "Goodbye."
fi
};
I've been trying to figure this out for a few days now, and I hit a wall almost every time. Some errors I've fixed, but then new ones appear. As it is now, I get
syntax error near unexpected token `}'
Any help would be super appreciated!
until; ...dobut no correspondingdoneifs without an appropriate number offis, and also, what happens when a user entersa coffee, please, milk, but no sugar, will you?instead ofyesorno.