Shell转大写为小写

#!/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

  

posted @ 2018-01-23 21:38  ranwuer  阅读(263)  评论(0编辑  收藏  举报