当前位置:网站首页>24、shell编程-流程控制
24、shell编程-流程控制
2022-08-04 15:08:00 【51CTO】
条件选择
if语句
if判断条件是否满足,如果满足,则执行命令1,不满足执行条件2
格式 if commands; then commands;[elif commands;then commands;]...[else commands;] fi
单分支
双分支
多

case语句
case判断为多种条件匹配作为选择,如选择1 执行command1 选择2 执行command2
格式 case word in [pattern [|pattern]...) commands ;;]...esac
pattern支持通配符 * 任意长度任意字符 ?任意单个字符 []指定范围内任意单个字符 | 或 a|b代表a或者b

边栏推荐
猜你喜欢
随机推荐
Android Sqlite3基本命令
Next -21- 添加相册系列 - 1- 框架设置
Win10无法访问移动硬盘怎么解决
FRED Application: Capillary Electrophoresis System
C# 谁改了我的代码
leetcode:255 验证前序遍历序列二叉搜索树
Latex 去掉行号
Why does the decimal point appear when I press the space bar in word 2003?
IP第十八天笔记
[in-depth study of 4 g / 5 g / 6 g project - 50] : URLLC - 16 - the 3 GPP URLLC agreement, specification, technical principle of depth interpretation - 10 - high reliability technology - 1 - low codin
技术分享| 小程序实现音视频通话
leetcode:259. 较小的三数之和
华为云 & 达达,帮有情人“一键送达”
Redis-主从复制
CloudCompare&PCL 点云按网格划分(点云分幅)
Oracle database user creation, restart, import and export
leetcode: 255 Verify preorder traversal sequence binary search tree
普法教育结合VR全景,直观感受和学习法治精神
微软表示将向内部网络安全专家共享数据 为企业提供更安全保护
C语言写简单三子棋









