break , continue , exit
2016-04-25 14:21
477 查看
break,continue,exit
例一: #!/bin/bash ./etc/init.d/functions foriin`seq110`;do if[$i-eq3];then #continue#没有数字3 break #exit fi echo$i done echo"ok~" 例二: #!/bin/bash for((i=0;i<=5;i++));do if[$i-eq3];then #continue #break exit fi echo$i done
breakn :n表示跳出循环的层数,如果省略n表示跳出整个循环。
continuen :n表示退到第n层循环,如果省略n,表示跳过本次循环,忽略本次循环的剩余代码,进入下一次循环。
exitn :退出当前shell的程序,并返回n。n也可以省略。
相关文章推荐
- 数据库连接池性能比对(hikari druid c3p0 dbcp jdbc)
- 加密算法使用(一):用CRC32来压缩32uuid字符串
- 控制EasyUI DataGrid高度
- UUID
- java反编译工具JD-GUI使用方法
- miui打开高级设置强退
- Gradle 实战(3)—— 添加 Gradle 依赖与 build.gradle 配置初识
- Barbican M 版本 ReleaseNotes和Blueprints
- php 如何使用LigerUI grid插件
- UIBezierPath画圆弧的记录
- uibutton
- poj 2299 Ultra-QuickSort 归并排序(求逆序数模板)
- APUE------进程关系
- Visual Studio通过Web Deploy发布网站报错:An error occurred when the request was processed on the remote computer.
- 63. Unique Paths II
- 62. Unique Paths
- UITableView
- UITextView的使用详解
- UINavigationController
- Android学习之 图解调用invalidate()和requestLayout()的过程