这个问题在这里已有答案:
我有一个if / then语句提示用户输入:
if [[ "$email_answer" = [Yy] ]]; then
除了“Y”或“y”之外,我如何让该陈述接受“是”,“是”或“是”这个词?
您可以使用case:
case
case $email_answer in [yY][eE][sS]|[yY]) ;; esac