【shell】脚本中显示成功、错误、警告函数

# cat echo.sh

############################################
#!/bin/bash

function log_failure_msg() {

    echo "$@" "[ FAILED ]"

}

function log_success_msg() {

    echo "$@" "[ OK ]"

}

function log_warnning_msg() {

    echo "$@" "[ Warn ]"

}

log_success_msg()

{

    echo " SUCCESS! $@"

}

log_failure_msg()

{

    echo " ERROR! $@"

}

log_warnning_msg()

{

    echo " Warnning! $@"

}

log_success_msg  "111"

log_failure_msg  "222"

log_warnning_msg  "333"

######################################

 

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页