189 8069 5689

shell中颜色设置-创新互联

出入任意字符串,使其变成想要的颜色:

成都创新互联公司从2013年成立,是专业互联网技术服务公司,拥有项目成都网站设计、做网站网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元扬州做网站,已为上家服务,为扬州各地企业和个人服务,联系电话:18982081108
#!/bin/sh
plus_color(){
RED_COLOR='\E[1;31m'
GREEN_COLOR='\E[1;32m'
YELLOW_COLOR='\E[1;33m'
BLUE_COLOR='\E[1;34m'
PINK_COLOR='\E[1;35m'
RES='\E[0m'
if [ $# -ne 2 ]
  then
    echo "usage $0:content {red|yellow|blue|green}"
    exit
fi
case "$2" in
   red|RED)
           echo -e "${RED_COLOR}$1${RES}"
           ;;
   yellow|YELLOW)
           echo -e "${YELLOW_COLOR}$1${RES}"
           ;;
   green|GREEN)
           echo -e "${GREEN_COLOR}$1${RES}"
           ;;
   blue|BLUE)
           echo -e "${BLUE_COLOR}$1${RES}"
           ;;
   pink|PINK)
           echo -e "${PINK_COLOR}$1${RES}"
           ;;
   *)
           echo "usage $0:content {red|yellow|blue|green}"
esac
}

plus_color "I" red
plus_color "am" yellow
plus_color "you" blue

标题名称:shell中颜色设置-创新互联
本文地址:http://cdxtjz.cn/article/cdeggj.html

其他资讯