#!/bin/bash #要求用户输入查询一个字母,当输入到Q时,则退出 for ((;;));do echo -n -e " 请输入需要查询的字母:" read CH if [ $CH == "Q" -o $CH == "q" ]; then break else echo "你查询的字母是$CH,请继续" fi done