流程控制是面向过程的编程思想,是对问题的解决步骤的代码化!
号外:mysql的内连接删除 delete a from table_aaa as a inner join table_bb as b set a.djxh=b.djxh; 跳脱字符,接触特殊字符的含义,原样输出字符 escape || //or if/while $# //参数总数量,局部 $* //完全的参数字符串,整体 $1..$x,不含$0 $@
#!/bin/bash //不写默认sh echo "are you ok? $*" //依次输出参数 shift n //向左移动n个字符,默认n是1,左移1 test expression //测试表达式,true/false //shell流程控制 #if fi exp1 ; then commands fi if exp1 //对称行if -->fi then commands elif exp2 commands else exp3 commands fi #case case var1 in str1) commands;; //;;终止符跳出判断 str2) commands;; *) commands;; esac #for for var1 in list //对list的每个参数,走一遍操作 do commands done for var1 //对着参数操作 do commands done #while until while : | true |exp //条件为真则继续操作 do commands done until exp //条件为假不在继续操作, do commands done #break/continue break //退出当前循环结构 continue //终止继续,执行下一次循环