日期:2014-05-16  浏览次数:20710 次

shell中if判断用法??
shell的if语句中有没有这种用法:
if $1 in ('01,'02','03') then
do something
fi


如果没有那该怎么判断这样的语句???

------解决方案--------------------
for var in 01 02 02;do
 if [ "$var" = "$1" ];then
do something;
 fi
done
------解决方案--------------------
chinaunix :shell基础十二篇
------解决方案--------------------
if [ "$1" = "01" -o "$1" = "02" -o "$1" = "03" ]; then