From 1c9e362ce02bd966f50fc6b95813f700e19c11ce Mon Sep 17 00:00:00 2001 From: Sandino Araico Sanchez Date: Thu, 22 Dec 2016 23:35:03 -0600 Subject: [PATCH] use variables for colored output --- scripts/test-badblocks | 2 +- scripts/test-memtester | 2 +- scripts/test-variables | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/test-badblocks b/scripts/test-badblocks index 5ec669a..e3a8e7c 100755 --- a/scripts/test-badblocks +++ b/scripts/test-badblocks @@ -123,7 +123,7 @@ fi if [[ $SUMMARY == csv ]] ; then echo "=====> BADBLOCKS CSV SUMMARY <=====" cat $OUTPUT_DIR/badblocks.csv \ - | sed "s/^\([^|]\+\)/${BLD}\1${OFF}/ ; s/OK/${GRN}OK${OFF}/ ; s/FAIL/${RED}FAIL${OFF}/ ; s/RESULT/${BLD}RESULT${OFF}/ " + | sed "s/^\([^|]\+\)/${BLD}\1${OFF}/ ; s/OK/$RES_OK/ ; s/FAIL/$RES_FAIL/ ; s/RESULT/$RES_ULT/ " # | sed 's/empty/W87152YGWGM/g' # Serial number for debugging fi diff --git a/scripts/test-memtester b/scripts/test-memtester index db57274..b4b9bd1 100755 --- a/scripts/test-memtester +++ b/scripts/test-memtester @@ -113,7 +113,7 @@ if [[ "$SUMMARY" != "0" ]] ; then done if [[ $SUMMARY == csv ]] ; then cat $OUTPUT_DIR/memtester.csv \ - | sed "s/^\([^|]\+\)/${BLD}\1${OFF}/ ; s/OK/${GRN}OK${OFF}/ ; s/FAIL/${RED}FAIL${OFF}/ ; s/RESULT/${BLD}RESULT${OFF}/ " + | sed "s/^\([^|]\+\)/${BLD}\1${OFF}/ ; s/OK/$RES_OK/ ; s/FAIL/$RES_FAIL/ ; s/RESULT/$RES_ULT/ " fi fi diff --git a/scripts/test-variables b/scripts/test-variables index 3a1a603..ebfb57c 100755 --- a/scripts/test-variables +++ b/scripts/test-variables @@ -9,7 +9,8 @@ RED_BOLD=$'\e[31;1m' OFF=$'\e[0;0m' RES_OK=${GRN}OK${OFF} -RES_FAIL="${RED}FAIL${OFF}" +RES_FAIL=${RED}FAIL${OFF} +RES_ULT=${BLD}RESULT${OFF} #RES_FAIL_BLINK="${RED_BLINK}FAIL${OFF}" RES_FAIL_BIG="${RED_BOLD}######## FAIL ########${OFF}"