if条件判断CONDITION:
bash命令:基于命令的执行结果状态
成功:true
失败:flase
成功或失败的意义取决于用到的命令
单分支:
if CONDITION; then
if-true
fi
双分支:
if CONDITION; then
if-true
else
if-flase
fi
多分支:
if CONDITION1; then
if-true
elif CONDITION2; then
if-true
elif CONDITION3; then
if-true
...
else
all-flase
fi
自上而下,逐条件进行判断,第一次遇到为“真”条件时,执行其分&