21 lines
366 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
#Program:
# 这个shell脚本将介绍case的使用方法输入1-3三个数字对不同的情况做不同的回应
echo -n "请输入一个数字 1到3:"
read num
case $num in
1)
echo "你输入了 1"
;;
2)
echo "你输入了 2"
;;
3)
echo "你输入了 3"
;;
*)
echo "你输入的值不在范围"
;;
esac