Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to set colors in shell

Shulou Source: shulou.com Published: 2022-06-03 03:41:07 10月04日 Update

How do I set colors in shell? In view of this problem, this article gives the corresponding analysis and answers, hoping to help more friends who want to solve this problem to find a more simple and feasible way.

Enter and leave any string to make it the desired color:

#! / bin/shplus_color () {RED_COLOR='\ E [1x 31m 0:content 0:content {red | yellow | green} "exitficase" $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" redplus_color "am" yellowplus_color "you" blue

After reading the above, have you mastered the method of setting colors in shell? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Color more center content problem easy easy method character string skill method friend article industry information channel channel analysis help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MariaDB Apple Huawei Linux