shell打印 信息函数

打印相关的信息

#!/bin/bash
source /etc/rc.d/init.d/functions;

PrintResult()
{
        #echo "arg0 = $0";
        #echo "arg1 = $1";
        #echo "arg2 = $2";
        #echo "arg3 = $3";

        if [ $1 = 0  ] ; then
                action "$2"  /bin/true
        else
                action "$2" /bin/false
                exit $3
        fi
}

#for test
#PrintResult 0 "first ok...";
#PrintResult 1 "hello, andylin";
#PrintResult 0 "ok, succ!";
#PrintResult 2 "other result!";
 

猜你喜欢

转载自andylin02.iteye.com/blog/825423
今日推荐