#!/bin/bash read -p "please input Y/N" keyWord if [ "$keyWord" == "Y" ] || [ "$keyWord" == "y" ] ; then echo 'OK...countinue' fi if [ "$keyWord" == "N" ] || [ "$keyWord" == "n" ] ; then echo 'Oh interrupt' fi read -p "input a number : " num if [ "$num" == "1" ] ; then #分号面有空格是对的,没有空格也是对的,同理分号与then之间也一样。 echo '--- A ---' elif [ "$num" == "2" ];then # echo '--- B ---' else echo '--- C ---' fi