echo "Hi $username, guess what my favourite colour is!"
count=0
while [[ $count -ne 1 ]]
do
read colour
if ["$colour" -eq "forget it"]
then
$count=1
echo "See ya later!"
elif ["$colour" -eq "watermelon"]
then
$count=1
echo "You guessed correctly! Great job!"
fi
echo "try again or write forget it to give up"
done
Heres the script for a guessing game, for some reason it reads $colour as a literal when i pass it through the while loop and gives me errors like:
(if i passed in red for $colour)
[red: command not found
Why is it doing this???!