if判断:

if [$? -eq 0];then

  echo "xxxxxxxxxxx"

else

  echo "xxxxxxxxxxxxx"

fi

case判断:

case $name in

xxx)

  echo "xxxxxxx"

xxx)

  echo "xxxxxx"

esac

for循环

for i in $(seq 1-3)

  do

    echo "xxxx"

  done

while循环:

i=1

while((i<=10))

  do

    echo $i

    let i++

  done

while [1]    永久循环

  do

    echo"ssssss"

    sleep 3

  done

while [1]

  do

    read -p "xxxxx":key

    test $key = x -o $key = X

    if [$? -eq 0]

      then

        echo "xxxxxxxxxx"

        continue  继续下一个循环

        echo "xxxxxxxx"  这里不会被输出

    else

      echo $key

    fi

  done

shell_02的更多相关文章

  1. Linux从入门到进阶全集——【第十四集:Shell基础命令】

    1,Shell就是命令行执行器 2,作用:将外层引用程序的例如ls ll等命令进行解释成01表示的二进制代码给内核,从而让硬件执行:硬件的执行结果返回给shell,shell解释成我们能看得懂的代码返 ...

随机推荐

  1. linux - camera capture

    //cut a picture#include <stdio.h>#include <stdlib.h>#include <string.h>#include &l ...

  2. Android——布局(线性布局linearLayout,表格布局TableLayout,帧布局FrameLayout)

    线性布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:androi ...

  3. Android——Android studio项目中如何查看R.java文件(转)

    Android Studio 是Google推出的一个Android开发环境,它集成了Android 开发工具用于开发和调试,类似 Eclipse ADT.Google公司停止对eclipse的后续支 ...

  4. httpoxy 漏洞预警及修复方案

    影响范围 PHP.Go.Python等开启CGI(Client)模式的脚本语言 Language 环境依赖 HTTP Client PHP php-fpmmod_php Guzzle 4+Artax ...

  5. pip和 easy_insall的区别

    作为Python爱好者,如果不知道easy_install或者pip中的任何一个的话,那么......   easy_insall的作用和perl中的cpan,ruby中的gem类似,都提供了在线一键 ...

  6. serv-u ftp服务器搭建

    以前在学校的时候,学校的整个宿舍楼都是在一个局域网中,经常有人用个人电脑搭个网站或者FTP啊什么的,主要是进行一些影视资源的传播活动.不乏有些资源充沛的有志青年利用业余时间翻译某岛国影视资源,利用局域 ...

  7. 详谈JavaScript 匿名函数及闭包

    1.匿名函数函数是JavaScript中最灵活的一种对象,这里只是讲解其匿名函数的用途.匿名函数:就是没有函数名的函数. 1.1 函数的定义,首先简单介绍一下函数的定义,大致可分为三种方式 第一种:这 ...

  8. MFC存储图片到SQL Server数据库

    第一步:建立数据库表,比如:id char,pic image. 第二步:建立MFC单文档应用程序,再添加类CMyRecordset,基类选择CRecordset,导入数据库的刚建立的表. 第三步:在 ...

  9. Using XSLT and Open XML to Create a Word 2007 Document

    Summary: Learn how to transform XML data into a Word 2007 document by starting with an existing docu ...

  10. XCODE5 真机測试

    原文地址: http://my.oschina.net/u/1245365/blog/196420  亲測 可用 ios申请真机调试( xcode 5)具体解析 摘要 我们做ios项目时.模拟器仅仅能 ...