Get the App
SLTechnology News&Howtos  ›  Servers  › 

Color setting in shell

Shulou Source: shulou.com Published: 2022-06-02 09:32:26 10月03日 Update

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

Tags: Color character string Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple MySQL MariaDB NVidia OPPO Reno