天天看點

shell case...esac

[[email protected] shellTest]$ vi test7.sh

case $1 in

 one)

        echo "one"

        ;;

 two)

        echo "two"

        ;;

 three)

        echo "three"

        ;;

 *)

        echo "usage{one|two|three|"

        exit 1

esac 

[[email protected] shellTest]$ sh test7.sh

usage{one|two|three|

[[email protected] shellTest]$ sh test7.sh one

one