奋起直追,fighting
我在这里!

常用格式

格式一:

if 条件; then

    语句

fi

格式二:

if 条件; then

    语句

else

    语句

fi

格式三:

if 条件; then

    语句

elif 条件; then

    语句

fi

格式四:

if 条件; then

    语句

elif 条件; then

    语句

else

    语句

fi

使用示例

(1)判断字符串相等

if [ "foo" = "foo" ]; then
   echo expression evaluated as true
else
    echo expression evaluated as false
 fi

result  : expression evaluated as true

(2)

---------------------初次乍到,待补充------

posted on 2015-10-22 17:25  Thomas_C  阅读(146)  评论(0编辑  收藏  举报