#!/bin/bash
#定义字体颜色
function RedFont(){
echo -e "\033[31mError: $1 \033[0m"
}
function GreenFont(){
echo -e "\033[32mSuccess: $1 \033[0m"
}
function YellowFont(){
echo -e "\033[33mWarning: $1 \033[0m"
}
#判断上一次执行成功
function Status_Judge(){
if [ $? -eq 0 ];then
GreenFont "$1"
else
RedFont "$2"
exit
fi
}
常用脚本开头
于 2023-07-19 14:18:10 首次发布