码迷,mamicode.com
首页 > 其他好文 > 详细

if case

时间:2018-01-26 11:07:33      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:white   $1   bin   apple   echo   span   hit   tab   style   

#!/bin/bash

if [ $1 -lt 3 ];then

       echo redhat

elif    [ $1 -eq 3  ];then

       echo green

elif    [ $1 -gt 3 -a $1 -lt 5 ];then

       echo yellow

else

       echo white

fi



--------------------------------------

case $1 in

       1|one|first)echo redhat;;

       2)echo yellow;;

       3)echo green;;

       *)echo blue;;

esac


if case

标签:white   $1   bin   apple   echo   span   hit   tab   style   

原文地址:http://blog.51cto.com/11280985/2065290

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!