Tip
for ansicolor, either using \033[XXm
directly, or use following c()
function as below:
# credit: https://github.com/ppo/bash-colors # author: @ppo # shellcheck disable=SC2015,SC2059 c() { [ $# == 0 ] && printf "\e[0m" || printf "$1" | sed 's/\(.\)/\1;/g;s/\([SDIUFNHT]\)/2\1/g;s/\([KRGYBMCW]\)/3\1/g;s/\([krgybmcw]\)/4\1/g;y/SDIUFNHTsdiufnhtKRGYBMCWkrgybmcw/12345789123457890123456701234567/;s/^\(.*\);$/\\e[\1m/g'; }