1.条件判断: if 使用: if condition; then commands; fi if else 使用: if condition; then commands; else if condition; then commands; else commands; fi 说明: if和else语句可以进行嵌套.if的条件判断部分可能会变得很长, 但可以用逻辑运算符将它变得简洁一些: [ condition ] && action; # 如果condition为真,则执行acti…
参考资料: shell字符串分割再循环:http://www.shangxueba.com/jingyan/1633455.html linux shell中 if else以及大于.小于.等于逻辑表达式介绍:http://www.jb51.net/article/34332.htm Shell数组:shell数组的定义.数组长度:http://c.biancheng.net/cpp/view/7002.html shell 数组长度:http://blog.csdn.net/shaobingj…