欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Shell高亮显示 博客分类: Linux Shell高亮显示 

程序员文章站 2024-03-20 12:26:16
...
一 基本格式
echo -e 终端颜色 + 显示内容 + 结束后的颜色
 
二 举例
echo -e "\e[1;30m cakin say hi~ \e[1;0m"
echo -e "\e[1;30m" "cakin say hi~" $(tput sgr0)
 
三 显示效果

Shell高亮显示
            
    
    博客分类: Linux Shell高亮显示 
 

<!--5f39ae17-8c62-4a45-bc43-b32064c9388a:W3siYmxvY2tUeXBlIjoicGFyYWdyYXBoIiwic3R5bGVzIjp7ImFsaWduIjoibGVmdCIsImluZGVudCI6MCwidGV4dC1pbmRlbnQiOjAsImxpbmUtaGVpZ2h0IjoxLjc1fSwiYmxvY2tJZCI6IjU0bXVtdDE1MDI0OTg2ODM4MjQiLCJyaWNoVGV4dCI6eyJpc1JpY2hUZXh0Ijp0cnVlLCJrZWVwTGluZUJyZWFrIjp0cnVlLCJkYXRhIjpbeyJjaGFyIjoi5LiAIiwic3R5bGVzIjp7ImJvbGQiOnRydWV9fSx7ImNoYXIiOiIgIiwic3R5bGVzIjp7ImJvbGQiOnRydWV9fSx7ImNoYXIiOiLln7oiLCJzdHlsZXMiOnsiYm9sZCI6dHJ1ZX19LHsiY2hhciI6IuacrCIsInN0eWxlcyI6eyJib2xkIjp0cnVlfX0seyJjaGFyIjoi5qC8Iiwic3R5bGVzIjp7ImJvbGQiOnRydWV9fSx7ImNoYXIiOiLlvI8iLCJzdHlsZXMiOnsiYm9sZCI6dHJ1ZX19XX19LHsiYmxvY2tUeXBlIjoicGFyYWdyYXBoIiwic3R5bGVzIjp7ImFsaWduIjoibGVmdCIsImluZGVudCI6MCwidGV4dC1pbmRlbnQiOjAsImxpbmUtaGVpZ2h0IjoxLjc1fSwiYmxvY2tJZCI6IjY1aGt6bzE1MDI0OTg3NDIzOTQiLCJyaWNoVGV4dCI6eyJpc1JpY2hUZXh0Ijp0cnVlLCJrZWVw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yaWNoVGV4dCI6eyJpc1JpY2hUZXh0Ijp0cnVlLCJrZWVwTGluZUJyZWFrIjp0cnVlLCJkYXRhIjpbeyJjaGFyIjoiMSIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoiNyIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoiMSIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoiLiIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoicCIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoibiIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX0seyJjaGFyIjoiZyIsInN0eWxlcyI6eyJjb2xvciI6IiNERjQwMkEifX1dfX0seyJibG9ja1R5cGUiOiJwYXJhZ3JhcGgiLCJzdHlsZXMiOnsiYWxpZ24iOiJsZWZ0IiwiaW5kZW50IjowLCJ0ZXh0LWluZGVudCI6MCwibGluZS1oZWlnaHQiOjEuNzV9LCJibG9ja0lkIjoiOTdsdmtqMTUwMjQ5OTExNzI4OCIsInJpY2hUZXh0Ijp7ImlzUmljaFRleHQiOnRydWUsImtlZXBMaW5lQnJlYWsiOnRydWUsImRhdGEiOltdfX1d-->

 
  • Shell高亮显示
            
    
    博客分类: Linux Shell高亮显示 
  • 大小: 15 KB
相关标签: Shell 高亮显示