use variables for colored output

This commit is contained in:
Sandino Araico Sanchez 2016-12-22 23:35:03 -06:00
parent cec57c4f9e
commit 1c9e362ce0
3 changed files with 4 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -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}"