I'm creating a shell script to automatically do sudo apt update/upgrade/autoremove/autoclean (first bash script of my life), everything works but the yes or no section
Here's my code:
#!/bin/bash
echo "Updating and upgrading system components"
sudo apt update
sudo apt upgrade
echo "Starting cleaning and removing unnecessary files"
sudo apt autoremove
sudo apt autoclean
echo "Do you want to check if a new distribution update is available? Y/N"
read -p "Check system distribution updates?" answer
if ["$answer" == "Y" || "$answer" == "Yes" || "$answer" == "y" || "$answer" == "yes"]
then
sudo do-release-upgrade
else
exit
fi
After answering one of these option shell starts printing in loop "==Yes"
Any idea?