I am writing a script that accepts a user input to start a while loop, right now my syntax for it is
echo -e "Would you like to run the script? (Y or N): \c"
read ans
while [ $ans = "Y" ]
do
#the script
My question is how can I make this accept multiple inputs? I would like for the script to be able to accept other forms of Y, such as Yes, yes, or y. I tried to this by changing the code to:
echo -e "Would you like to run the script? (Y or N): \c"
read ans
while [ $ans = "Y","Yes","y","yes" ]
do
#the script
but it still gave me errors. Anyone have an idea how to do this?