From 3f640cbd86640ef16da6adf2a9657f12d82af403 Mon Sep 17 00:00:00 2001 From: Ralf Jung <post@ralfj.de> Date: Sat, 24 Mar 2018 12:53:31 +0100 Subject: [PATCH] fix colors --- ansi-colors.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ansi-colors.sh b/ansi-colors.sh index 53f9144..fce0a90 100644 --- a/ansi-colors.sh +++ b/ansi-colors.sh @@ -1,19 +1,18 @@ # provide some variables to get colorful output -DARKGRAY='\033[1;30m' -RED='\033[0;31m' -LIGHTRED='\033[1;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -PURPLE='\033[0;35m' -LIGHTPURPLE='\033[1;35m' -CYAN='\033[0;36m' -WHITE='\033[1;37m' -RESET='\033[0m' +DARKGRAY='0;30' +RED='0;31' +LIGHTRED='1;31' +GREEN='0;32' +YELLOW='1;33' +BLUE='0;34' +PURPLE='0;35' +LIGHTPURPLE='1;35' +CYAN='0;36' +WHITE='1;37' echo_color() { # $1: the color # $2: the string - echo "$1$2$RESET" + echo -e "\e[${1}m${2}\e[0m" } -- GitLab