首页 服务端 linux 正文

shell条件判断

long 2020-07-23 06:49 shell 人气539

语法

if [ 条件 ] 

then

  语句

else

  语句

fi


单行

if [ 条件 ];then 语句;fi


多重条件

if [ 条件 ]

then

  语句

elif [ 条件 ]

then

  语句

fi