shell脚本编程基础12、13

1.if-then语句  退出状态码为0执行

2.if-then-else语句  else部分的另一种形式elif 

3.test命令/[  ]  通过if-then语句测试其他条件

4.数值比较  -eq  -ge  -gt  -le  -lt  -ne

5.字符串比较  =  !=  <  >  -n  -z

6.文件比较  -d -e -f -r -s -w -x -O -G -nt -ot

7.复合条件测试  [  ] && [  ] || [  ]

8.用于数学表达式的双括号  ((  ))

9.用于高级字符串处理功能的双方括号  [[  ]]

10.case命令  指定的变量与不同模式的匹配

11.for命令  for var in list do commands done

12.内部字段分隔符IFS  空格、制表符、换行符

13.用通配符读取目录  *

14.C语言风格的for命令  for (( variable assignment; condition; iteration process ))

15.while命令 while test command do other commands done

16.until命令  until test commands do other commands done

17.break命令  break 2

18.continue命令  continue 2

19.处理循环的输出  done > output.txt

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值