Shell continue循环
[oracle@june ~]$ cat continue.sh
for i in a b c d e f g
do
if [ "$i" = "c" ]
then
echo xxxxxxxxxxxxxx
echo "跳过的字符为"$i
continue
fi
done
[oracle@june ~]$ sh -x ./continue.sh
+ for i in a b c d e f g
+ '[' a = c ']'
+ for i in a b c d e f g
+ '[' b = c ']'
+ for i in a b c d e f g
+ '[' c = c ']'
+ echo xxxxxxxxxxxxxx
xxxxxxxxxxxxxx
+ echo $'\314\370\271\375\265\304\327\326\267\373\316\252c'
跳过的字符为c
+ continue
+ for i in a b c d e f g
+ '[' d = c ']'
+ for i in a b c d e f g
+ '[' e = c ']'
+ for i in a b c d e f g
+ '[' f = c ']'
+ for i in a b c d e f g
+ '[' g = c ']' continue 跳过当前循环步,回到循环开始
Shell continue循环的更多相关文章
- shell脚本-循环选择语句
shell脚本-循环选择语句 过程式编程语言: 顺序执行 选择执行 循环执行 注:条件中的变量,可以在执行语句中使用,不用在加上"$". if语句 根据命令的退出状态来执行命令 单 ...
- Shell 编程 循环语句
本篇主要写一些shell脚本循环语句的使用. for 循环 指定次数 #!/bin/bash for ((i=1;i<=10;i++)) do echo $i done [root@localh ...
- Shell双重循环、图形排列及九九乘法表
Shell双重循环.图形排列及九九乘法表 目录 Shell双重循环.图形排列及九九乘法表 一.双重循环 1. 双重循环概述 2. 双重循环结构 二.循环特殊操作 1. exit 2. break 3. ...
- Linux Shell系列教程之(十二)Shell until循环
本文是Linux Shell系列教程的第(十二)篇,更多Linux Shell教程请看:Linux Shell系列教程 在上两篇文章Linux Shell系列教程之(十)Shell for循环和Lin ...
- shell for循环+case的脚本(监控程序状态)
分享一个shell for循环+case的脚本(监控程序状态) 分享一个for循环+case的脚本(监控程序状态并执行相关操作) ,供大家学习参考. 复制代码代码如下: #/bin/bash set ...
- shell 各种循环判断
shell支持的循环有 Shell if else Shell case esac Shell for循环 Shell while循环 Shell until循环
- shell脚本--循环结构
shell的循环结构有while和for两种 for循环 #!/bin/bash #文件名:test.sh i=4 for i in 2 4 6 8 10 do echo $i done echo $ ...
- Linux Shell系列教程之(十一)Shell while循环
本文是Linux Shell系列教程的第(十一)篇,更多Linux Shell教程请看:Linux Shell系列教程 在上一篇Linux Shell系列教程之(十)Shell for循环中,我们已经 ...
- Linux Shell系列教程之(十)Shell for循环
本文是Linux Shell系列教程的第(十)篇,更多Linux Shell教程请看:Linux Shell系列教程 基本任何语言都有自己的循环语句,Shell当然也不例外,今天就为大家介绍下Shel ...
随机推荐
- 在mac上利用homebrew安装软件
在mac经常需要安装一些软件,你可以通过app store下载,或者可以通过浏览袭搜索下载.这里介绍通过homebrew安装一些软件,它会自动为你下载一些软件的相关依赖,免去安装的烦恼. 首先我们需要 ...
- UITextView ios7
UITextView *textView2 = [[UITextView alloc]initWithFrame:CGRectMake(, textView1.frame.size.height + ...
- Android Toast封装
package com.whoop.mobile.trace.util; import android.content.Context; import android.content.res.Reso ...
- @余凯_西二旗民工 【SVM之菜鸟实现】—5步SVM
#翻译#了下 余凯老师的 心法 以前的一篇博文:二分类SVM方法Matlab实现 前几日实现了下,虽然说是Linear-SVM,但是只要可以有映射函数也可以做kernel-svm function [ ...
- [Angular 2] Dispatching Action with Payloads and type to Reducers
While action types allow you tell your reducer what action it should take, the payload is the data t ...
- 20M宽带的网速等价于多少?
最近有朋友问我:我家的宽带是20兆的,怎么网速这么慢? 运营商说的20M,完整的单位应该是20Mbps(bps:比特率),而日常中所说的下载速度单位是MB,两者是不一样的. 它们之间的换算关系是:1M ...
- Debian 桌面美化
Debian 桌面美化 安装 gnome-tweak-tool aptitude install gnome-tweak-tool 登陆gnome-look下载主题包 gnome-look上有很多主题 ...
- mysql02
-- 查询课程名称 和年级的名称 -- 非等值连接查询 SELECT subjectname,gradeName FROM `subject`,grade -- 等值连接查询 SELECT subje ...
- json数组传递到后台controller
现前台有如下格式的数据需要传递到后台的controller, public class UpdatePara { public int RoleID { get; set; } public List ...
- (转)TortoiseSVN使用简介
TortoiseSVN使用简介 TortoiseSVN使用简介 2009-04-24 来源:dev.idv.tw 1 安装及下载client 端 2 什么是SVN(Subversion)? 3 为甚么 ...