shell编程中的条件判断
: 表示为真
条件
if-then
case
if-then
单条件
if command
then
commands
fi
当command返回码为0时 条件成立
在if,elif中要注意
中括号 [] 里面左右两边必须要有空格
== 两边也必须有空格 否者也不对
if.sh #! /bin/bash if : then echo true fi [root@centos1 sh]# sh -x if.sh + '[' 1 == 1 ']' + echo true true