Shell语法 条件、循环
来源:互联网 发布:淘宝哪家电脑主机好 编辑:程序博客网 时间:2024/06/05 15:17
if [ expression 1 ]then Statement(s) to be executed if expression 1 is trueelif [ expression 2 ]then Statement(s) to be executed if expression 2 is trueelif [ expression 3 ]then Statement(s) to be executed if expression 3 is trueelse Statement(s) to be executed if no expression is truefi
case 值 in模式1【支持正则】) command1 command2 command3 ;;模式2【支持正则】) command1 command2 command3 ;;*) command1 command2 command3 ;;esac
for 变量 in 列表do command1 command2 ... commandNdone例for loop in 1 2 3 4 5do echo "The value is: $loop"done
while循环COUNTER=0while [ $COUNTER -lt 5 ]do COUNTER='expr $COUNTER+1' echo $COUNTERdone##依次将文件的每一行赋给变量#!/bin/bashwhile read iid;do echo "[$iid]"done <./iid
跳出循环break命令continue命令
1 0
- Shell语法 条件、循环
- 条件,循环基本语法
- shell 条件控制,循环
- shell 循环判断语法
- shell -- 循环语法
- 【Linux】中shell脚本语法篇之条件语句和循环语句
- shell循环和条件判断
- Shell 中几个循环语法
- shell script中的循环语法
- Linux shell for循环语法
- python条件、循环和其他语法
- Shell脚本语法 条件测试:test
- shell脚本编程-脚本语法-条件测试
- shell的语法之变量、条件
- shell中的循环语句和条件语句
- Shell入门之条件循环学习笔记
- shell循环sleep while例子 条件判断
- shell中的条件语句与循环语句
- Android studio模版提高开发效率
- 查找命令 grep、 find 命令
- JDBC事务和JTA事务的区别
- 基于孤傲苍狼的上传下载总结出的java工具类
- 菜鸟工作历程:virtualbox折腾小记
- Shell语法 条件、循环
- 性能测试知多少----性能测试分类之我见
- PowerDesigner15.1创建模型及生成带注释sql操作手册
- 常用的排序算法
- scala 类型强转
- 从头到尾打印链表
- opencv常用代码
- 【多线程】多线程教程之二---线程间同步
- mysql 5.5 安装图解(附安装到最后停住的解决方法)