Shell 条件语句
shell 条件语句
if
1 | if test-commands; then |
case
1 | case word in |
示例
1 | echo -n "Enter the name of an animal: " |
备注:
*)相当于其他语言的default;;相当于break,;&相当于fall through|分割多个模式,相当于or
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 yxibng!
1 | if test-commands; then |
1 | case word in |
示例
1 | echo -n "Enter the name of an animal: " |
备注:
*)相当于其他语言的default
;;相当于break, ;&相当于fall through
|分割多个模式,相当于or