Hello,
I am trying to create a bash shell script that is interactive.
A question is asked and an answer (Y or N) is required from the user.
How can I make it so the answer given can either be a Y or N
or a y or n?
Here is the snippet I am having difficulties on:
echo "Do you want to add users to this department? "
read YN
if [ $YN = "Y" ]
then
ADDUSERS
fi
How do I put in the script that the answer can be either Y or y or N or n?
I am trying to create a bash shell script that is interactive.
A question is asked and an answer (Y or N) is required from the user.
How can I make it so the answer given can either be a Y or N
or a y or n?
Here is the snippet I am having difficulties on:
echo "Do you want to add users to this department? "
read YN
if [ $YN = "Y" ]
then
ADDUSERS
fi
How do I put in the script that the answer can be either Y or y or N or n?