From f96e3e356a4a3f9196c27057e195a0d8baaec931 Mon Sep 17 00:00:00 2001 From: mini2024 Date: Tue, 11 Mar 2025 22:37:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A7=E5=88=B6=E5=8F=B0?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E9=A2=9C=E8=89=B2=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 print_red() 和 print_yellow() 彩色输出函数 - 扩展控制台输出颜色显示方案 --- 1.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/1.sh b/1.sh index fe4d756..8b58250 100644 --- a/1.sh +++ b/1.sh @@ -8,7 +8,9 @@ set -e # 遇到错误即退出 trap 'echo "Error on line $LINENO"' ERR +print_red() { echo -e "\033[31m\033[01m$1$2\033[0m"; } print_green() { echo -e "\033[32m\033[01m$1$2\033[0m"; } +print_yellow() { echo -e "\033[33m\033[01m$1$2\033[0m"; } # 先检查是 Debian 还是 Alpine if [ -f /etc/debian_version ]; then