for语句 do echo $loop done ` do echo $loop done for loop in `ls /tmp` do echo $loop done while语句 while true do read -p "请输入你的密码:" passwd if [ $passwd = "aixocm" ] then echo "密码输入正确,welcome" break else echo "密码输入错误" co…
不同于C语言和SHELL,python中没有switch case语句,关于为什么没有,官方的解释是这样的 使用Python模拟实现的方法: def switch_if(fun, x, y): if fun == 'add': return x + y elif fun == 'sub': return x - y elif fun == 'mul': return x * y elif fun == 'div': …
shell流控制:http://www.cnblogs.com/yunjiaofeifei/archive/2012/06/12/2546208.html 1.if then else 语句 if then else语句的基本格式如下: if 条件1 then 命令1 elif 条件2 then 命令2 else 命令3 fi if语句以if开头,而以fi结束,在shell中的控制流结构的分支语句都是像这样开头跟结束的语句相反反过来,如下面的case语句,以case开头,以esac结束.elif…