功能介绍哦:让echo输出字符串显示不同颜色
一、字体颜色(范围:30-37)
echo -e "\033[30m oldboy trainning \033[0m" 黑色字(黑色背景,黑色字无法显示)echo -e "\033[31m oldboy trainning \033[0m" 红色字echo -e "\033[32m oldboy trainning \033[0m" 绿色字echo -e "\033[33m oldboy trainning \033[0m" 黄色字echo -e "\033[34m oldboy trainning \033[0m" 蓝色字echo -e "\033[35m oldboy trainning \033[0m" 紫色字echo -e "\033[36m oldboy trainning \033[0m" 天蓝字echo -e "\033[37m oldboy trainning \033[0m" 白色字
black='\033[30m'red='\033[31m'green='\033[32m'yellow='\033[33m'blue='\033[34m'purple='\033[35m'navyblue='\033[36m'white='\033[37m'plain='\033[0m'
二、背景色(范围:40-47)
echo -e "\033[40;37m oldboy trainning \033[0m" 黑底白字(字体颜色匹配上面的,自己更改)echo -e "\033[41;37m oldboy trainning \033[0m" 红底白字echo -e "\033[42;37m oldboy trainning \033[0m" 绿底白字echo -e "\033[43;37m oldboy trainning \033[0m" 黄底白字echo -e "\033[44;37m oldboy trainning \033[0m" 蓝底白字echo -e "\033[45;37m oldboy trainning \033[0m" 紫底白字echo -e "\033[46;37m oldboy trainning \033[0m" 天蓝白字echo -e "\033[47;30m oldboy trainning \033[0m" 白底黑字
参考学习地址:http://oldboy.blog.51cto.com/