• 011#ANSI颜色系列


    #!/bin/bash
    # ANSI color ---
    
    initializeANSI()
    {
      esc="e"    # 同'33'
    
      # 前景色:
      blackf="${esc}[30m";
      redf="${esc}[31m";
      greenf="${esc}[32m";
      yellowf="${esc}[33m";
      bluef="${esc}[34m";
      purplef="${esc}[35m";
      cyanf="${esc}[36m";
      whitef="${esc}[37m";
    
      # 背景色:
      blackb="${esc}[40m";
      redb="${esc}[41m";
      greenb="${esc}[42m";
      yellowb="${esc}[43m";
      blueb="${esc}[44m";
      purpleb="${esc}[45m";
      cyanb="${esc}[46m";                                                                                               
      whiteb="${esc}[47m";
    
      # 粗体、斜体、下划线以及样式切换:
    
      boldon="${esc}[1m";
      boldoff="${esc}[22m";
      italicson="${esc}[3m";
      italicsoff="${esc}[23m";
      ulon="${esc}[4m";
      uloff="${esc}[24m";
      invon="${esc}[7m"; # 反色,前景色与背景色互换
      invoff="${esc}[27m";
      reset="${esc}[0m"
    }
    
    initializeANSI
    echo -e "
    ${yellowf}This is a phrase in yellow${redb} and red background.${reset}
    ${boldon}This is bold ${ulon}this is underline${reset}
    ${italicson}This is italics${italicsoff} and ${reset}reset to nornal
    ${yellowf}${redb}Warning 1${yellowb}${redf}Warning 2${reset}
    ${invon}${yellowf}${redb}Warning 1${invoff}${yellowb}${redf}Warning 2${reset}
    "
    
    *** 你必须十分努力,才能看起来毫不费力 ***
  • 相关阅读:
    数组的基本操作
    面向对象
    继承
    JavaBean规范
    JVM内存模型
    数组的排序
    this
    访问控制权限
    数组
    方法的重载
  • 原文地址:https://www.cnblogs.com/bigtree2pingping/p/13028253.html
Copyright © 2020-2023  润新知