运维网's Archiver
论坛
›
Shell/Powershell
› shell case-Linux 笔记整理
gznz12345
发表于 2018-8-22 07:40:00
shell case-Linux 笔记整理
认识case结构
# cat 5.sh
#!/bin/bash
read -t 5 -p "Please input a number: " n
m=$[$n%2]
case $m in
1)
echo "The number is jishu."
;;
0)
echo "The number is oushu."
;;
*)
echo "It is not jishu or oushu."
;;
esac
页:
[1]
查看完整版本:
shell case-Linux 笔记整理