Shell script輸出有顏色的文字
# Color defination
txtRed=$(tput setaf 1)
txtGreen=$(tput setaf 2)
txtYellow=$(tput setaf 3)
txtBlue=$(tput setaf 4)
txtPurple=$(tput setaf 5)
txtCyan=$(tput setaf 6)
txtWhite=$(tput setaf 7)
txtReset=$(tput sgr0)
# Style defination
txtBold=$(tput bold)
txtUL=$(tput smul)
# Example
echo "${txtRed}Red text"
echo "still Red text"
echo "$txtReset"
echo "Normal text"