Could someone help me out with this if statement? It's supposed to get a person's website, but it isn't working when I run it.
website=""
echo "Would you like to enter a website? Enter Yes/No"
read choice
if ["$choice" == "Yes"]
then
while ["$website" == ""]
do
echo "Please enter a website:";
read website;
done
else
website="None"
fi
Use spaces before and after the [ and ] characters
website=""
echo "Would you like to enter a website? Enter Yes/No"
read choice
if [ "$choice" == "Yes" ]
then
while [ "$website" == "" ]
do
echo "Please enter a website:";
read website;
done
else
website="None"
fi
And you don't need == when = would do.
And please use CODE-TAGS. And also say what's not working rather than just "it's not working".