#!/bin/bash # read a a=$(echo "$a" | awk '{print tolower($0)}') #转大写为小写 if [[ $a = 'y' || $a = 'yes' ]]; then echo YES elif [[ $a = 'n' || $a = 'no' ]]; then echo NO fi