In the following code snippet, 'if' part is always executed irrespective of whether I enter 'y' or 'n'. I am unable to figure out my mistake even after spending couple of hours. Can someone point out the mistake? Thank you!
Code:
echo "Do you want to delete?(y/n):"
read USERINPUT
echo $USERINPUT
if [ $USERINPUT="y" ]
then
echo "Deleted."
elif [ $USERINPUT="n" ]
then
echo "Not deleted."
fi