使用echo或者printf时,可以添加输出文本的颜色设置

echo -e "Maximum \e[1;31m" $max_threads "\e[0mthreads allowed!" >> $term_dir/summary

或者

printf("\033[;34mfile\033[0m")

 awk 参考:http://stackoverflow.com/questions/14482101/awk-adding-color-code-to-text

31开始代表前景色, 41开始代表背景色,至于具体颜色取决于当前shell的设置

linux shell设置颜色

 

相关文章:

  • 2021-06-25
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2021-07-02
  • 2022-01-19
  • 2022-12-23
猜你喜欢
  • 2021-09-01
  • 2022-12-23
  • 2022-01-01
  • 2022-02-03
  • 2021-11-29
  • 2021-06-14
相关资源
相似解决方案