Ok, so I'm trying to run a script where if the user enters y
or Y
, then the output is YES
but if the user inputs n
or N
then the output is NO
, this is what I have so far:
read character
if (( ("$character") == "y" )) || (( ("$character" == "Y") )); then
echo "YES"
else
echo "NO"
fi
When I run this code I get YES
successfully but inputting n
just results in YES
anyway.
I have no idea what I'm doing wrong and any I'd love some input.
Thanks in advance!