shell脚本中echo显示内容带颜色显示,echo显示带颜色,需要使用参数-e (当前终端使用一次 echo -e
后,echo对转义字符的解释功能打开,后续都转义字符都有效。)
格式如下:
echo -e " 33[字背景颜色;文字颜色m字符串 33[0m"
例如:
echo -e " 33[41;36m something here
shell脚本中echo显示内容带颜色显示,echo显示带颜色,需要使用参数-e (当前终端使用一次 echo -e
后,echo对转义字符的解释功能打开,后续都转义字符都有效。)
格式如下:
echo -e " 33[字背景颜色;文字颜色m字符串 33[0m"
例如:
echo -e " 33[41;36m something here