qfedu-linux-advanced-level/day1/d22.sh

26 lines
451 B
Bash
Raw Permalink Normal View History

2023-08-14 17:48:45 +08:00
#!/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