26 lines
451 B
Bash
26 lines
451 B
Bash
#!/bin/bash
|
|
|
|
echo "please input y/n"
|
|
read yn
|
|
|
|
case $yn in
|
|
# | 表示或的意思
|
|
y|Y|yes|Yes|YES)
|
|
echo "your input yes ..."
|
|
;;
|
|
n)
|
|
echo "your input no ..."
|
|
;;
|
|
*)
|
|
echo "your input is invalid argument"
|
|
exit 1
|
|
esac
|
|
|
|
# if [ "$yn" = "y" ]; then
|
|
# echo "your input yes ..."
|
|
# elif [ "$yn" = "n" ]
|
|
# then
|
|
# echo "your input no ..."
|
|
# else
|
|
# echo "your input is invalid argument"
|
|
# fi |