From eed0c8ca3b84eef0cd53989f6e94c3098c530d37 Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Mon, 21 Jun 2021 14:47:40 +0100 Subject: [PATCH] extract_utils: Skip colored echo when piped Change-Id: I8a03a36f3fa022e6858cc5c1dbca8b8037efed03 --- extract_utils.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extract_utils.sh b/extract_utils.sh index de62732..7d2785f 100644 --- a/extract_utils.sh +++ b/extract_utils.sh @@ -1800,7 +1800,7 @@ function colored_echo() { white|*) color=7 ;; # white or invalid color esac fi - tput setaf $color + if [ -t 1 ] ; then tput setaf $color; fi printf '%s\n' "$*" - tput sgr0 + if [ -t 1 ] ; then tput sgr0; fi }