27 lines
422 B
Bash
27 lines
422 B
Bash
|
function colorize() {
|
||
|
local TEXT=$2
|
||
|
local NO_COLOR="\033[0m"
|
||
|
case "$1" in
|
||
|
red)
|
||
|
local COLOR="\033[31m"
|
||
|
;;
|
||
|
green)
|
||
|
local COLOR="\033[32m"
|
||
|
;;
|
||
|
yellow)
|
||
|
local COLOR="\033[33m"
|
||
|
;;
|
||
|
blue)
|
||
|
local COLOR="\033[34m"
|
||
|
;;
|
||
|
magenta)
|
||
|
local COLOR="\033[35m"
|
||
|
;;
|
||
|
cyan)
|
||
|
local COLOR="\033[36m"
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
echo -e "${COLOR}${TEXT}${NO_COLOR}"
|
||
|
}
|