I want to make a shutdown script and it doesn't work as intended. This is what I wrote.
echo "Wanna shutdown (y/n)?"
read ANSWER
if [ $ANSWER=="y" ]
then
sudo shutdown -P now
else
printf "Something...."
whatever i press it just shuts down. Why?