美文网首页
shell脚本中的循环

shell脚本中的循环

作者: 随玉而安_gao | 来源:发表于2017-02-27 21:46 被阅读0次

for循环的基本结构:

for变量名in循环的条件;do

command

done

case循环基本结构:

case变量in

value1)

command

;;

value2)

command

;;

value3)

command

;;

*)

command

;;

esac

if循环语法结构:

if判断语句一; then

command

elif判断语句二; then

command

else

command

fi


if判断语句; then

command

else

command

fi

if判断语句; then

command

fi

for循环:

for变量名in循环的条件;do

command

done

while循环语法结构:

while条件; do

command

done

相关文章

  • shell

    1.双重循环 2.循环脚本 3.循环脚本 代码内容 文件内容 4.Linux shell中2>&1的含义解释 (全...

  • shell脚本中的循环

    for循环的基本结构:for变量名in循环的条件;docommanddone case循环基本结构:case变量i...

  • 【Linux 命令行与 shell 脚本编程大全】 13 更多的

    导览 在 shell 脚本中也可以使用 for 、 while 循环 until 循环则是和 while 循环在条...

  • Linux shell 用for循环100次的方法

    前言 循环不管在程序中还是脚本中都需要经常用到,在写shell脚本时,经常需要for进行100次循环。这里谈谈几种...

  • shell脚本for循环

    1、循环表达式1 输出cl_acl2014cl_res2014cl_laptop2014cl_res2015cl_...

  • shell脚本循环

    1.case循环 1.2使用case写一个nginx的启动脚本 2.使用脚本写一个jumpserver跳板机 3....

  • 2.2.2 shell循环语句和文件读写

    shell脚本有3种可用的循环结构,他们分别是while循环,for循环,until循环。其中for循环用法比较特...

  • crontab指定时间执行程序(秒)

    crontab 指定秒执行原理: shell脚本for循环 for语句实现循环指定秒数执行。laravel框架 ...

  • Shell脚本

    1、脚本的执行 2、条件判断 3、循环执行(loop) 4、Shell脚本的追踪与调试

  • shell 语法

    shell 语法如何抒写一个shell脚本shell脚本运行shell中的特殊符号管道重定向shell中数学运算脚...

网友评论

      本文标题:shell脚本中的循环

      本文链接:https://www.haomeiwen.com/subject/nijtgttx.html