shell条件判断语句

语法1(一个条件):

ifcondition

then

??? command1

??? command2

??? ...

fi

语法2(两个条件):

ifcondition

then

???command1

??? command2

??? ...

else

???command

fi

if condition1

then

??? command1

elif condition2

then

??? command2

else

??? commandN

fi

推荐阅读更多精彩内容