- #######################################
- # Custom printing function
- # Globals:
- # None
- # Arguments:
- # $1 0:OK 1:FAILED 2:INFO 3:NOTICE
- # message
- # Returns:
- # None
- #######################################
-
- Show() {
- # OK
- if (($1 == 0)); then
- echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[0]} OK $COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
- # FAILED
- elif (($1 == 1)); then
- echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[3]}FAILED$COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
- # INFO
- elif (($1 == 2)); then
- echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[0]} INFO $COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
- # NOTICE
- elif (($1 == 3)); then
- echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[4]}NOTICE$COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
- fi
- }
复制代码
以上代码如何修改,让他无视错误顺利执行 |