echo Display in shell script with color display, echo display with color, need to use parameters-The e format is as follows: The copy code code is as follows: Echo-E"\033[Word background color; text color m string \033[0m"For example, copy the code code as follows: Echo-E"\033[41;36m something here \033[0m"where 41 of the position represents the background, 36 of the position is the color of the word Note:1, the word background color and the text color are in English"" 2, there is a m behind the text color3, the string can have no space, if any, the output is also a space below is the corresponding word and background color, you can try to find out the different color with example copy code code as follows: Echo-E "\033[31m red Word \033[0m] echo-E "\033[34m yellow Word \033[0m] echo-E "\033[ A; 33m red bottom yellow word \033[0m] echo-E "\033[ A; 37m white on red background \033[0m] word color: -—–Panax NotoginsengCopy the code code as follows: Echo-E "\033[30m black word \033[0m] echo-E "\033[31m red Word \033[0m] echo-E "\033[32m green word \033[0m] echo-E "\033[33m yellow Word \033[0m] echo-E "\033[34m Blue Word \033[0m] echo-E "\033[35m purple word \033[0m] echo-E "\033[36m sky blue word \033[0m] echo-E "\033[37m white word \033[0m] background color range: +—– -Copy the code code as follows: Echo-E "\033[ +; 37m black background white \033[0m] echo-E "\033[ A; 37m white on red background \033[0m] echo-E "\033[ the; 37m Green bottom white \033[0m] echo-E "\033[ +; 37m white on yellow background \033[0m] echo-E "\033[ -; 37m Blue bottom white \033[0m] echo-E "\033[ $; 37m white on purple background033[0m] echo-E "\033[ $; 37m blue background white \033[0m] echo-E "\033[ -; 30m black word on white background \033[0m] final control option description The copy code code is as follows: \ -[0m close all properties \ -[1m set high brightness \ -[4m underline \ -[5m blinking \ -[7m reverse display \ -[8m blanking \ -[30m-\ -[37m set foreground color \ -[40m-\ -[47m set background color \ -[NA cursor moves up n rows \ -[NB cursor moves down n lines \ -[NC cursor shifts right n rows \ -[ND cursor moves left n rows \ -[y;xh set cursor position \ -[2J clear screen \ -[K clears the contents from the cursor to the end of the line \ -[s save cursor position \ -[u restore cursor position \ -[?25lHide cursor \ -[? 25h display cursor
Let the echo output in the shell script color