shell---条件判断
shell 条件判断的两种表现形式
# test方式
test -b /dev/sda1
# [] 方式
[ -b /dev/sda1 ]
[ -d /root ] && echo "yes" || echo "no"
== 判断字符串是否相等,-eq 是判断数值是否相等, 单=号是给变量赋值
shell 条件判断的两种表现形式
# test方式
test -b /dev/sda1
# [] 方式
[ -b /dev/sda1 ]
[ -d /root ] && echo "yes" || echo "no"
== 判断字符串是否相等,-eq 是判断数值是否相等, 单=号是给变量赋值