From a4e13337b80870fc613d7eab93a1cea401a1dae7 Mon Sep 17 00:00:00 2001 From: Vincent Brillault Date: Tue, 9 Jan 2018 14:12:27 +0100 Subject: [PATCH] No-color: interpret string (-e) to be able to mach \x1B --- spectre-meltdown-checker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index 820c10c..58b108b 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -130,7 +130,7 @@ __echo() msg="$@" if [ "$opt_no_color" = 1 ] ; then # strip ANSI color codes - msg=$(echo "$msg" | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g") + msg=$(/bin/echo -e "$msg" | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g") fi # explicitely call /bin/echo to avoid shell builtins that might not take options /bin/echo $opt -e "$msg"