无锡新吴区建设环保局网站,基金培训网站,seo快速排名首页,wordpress 后台密码概要
continue [n]主要用途
结束本次循环#xff0c;继续执行下一个for#xff0c;while或until循环#xff1b;可指定从第几层循环继续执行。
参数
n#xff08;可选#xff09;#xff1a;大于等于1的整数#xff0c;用于指定从第几层循环继续执行。
返回值
返回…概要
continue [n]主要用途
结束本次循环继续执行下一个forwhile或until循环可指定从第几层循环继续执行。
参数
n可选大于等于1的整数用于指定从第几层循环继续执行。
返回值
返回状态为成功除非n小于1。
示例
# continue的可选参数n缺省值为1。
for((i3;i0;i--)); do# 跳到内层for循环继续执行。for((j3;j0;j--)); doif((j2)); then# 换成continue 1时结果一样continuefiprintf %s %s\n ${i} ${j}done
done
# 输出结果
3 3
3 1
2 3
2 1
1 3
1 1# 当n为2时
# 跳到外层for循环继续执行。
for((i3;i0;i--)); dofor((j3;j0;j--)); doif((j2)); thencontinue 2fiprintf %s %s\n ${i} ${j}done
done
# 输出结果
3 3
2 3
1 3注意
该命令是bash内建命令相关的帮助信息请查看 help 命令。