In the color script of the linuxshell script, echo displays the content with color, and echo displays the color. the parameter-eformat must be used as follows: echo-e & quot; \ 033 [background color; text color m string \ 033 [0 m & quot; example: echo-e & quot; \ 033 [41; 36msomethin...
In the color script of the linux shell script, echo displays the content with color, and echo displays the color. the following-e format is required: echo-e "\ 033 [background color; text color m string \ 033 [0 m "example: echo-e" \ 033 [41; 36 m something here \ 033 [0 m "where 41 represents the background color, the position 36 represents the color of the word. note: www.2cto.com 1. the background color and text color are English "" 2. there is a m behind the text color 3. there can be no spaces before and after the string. If yes, the output also contains spaces and the corresponding characters and background colors. you can try different colors by yourself.
For example, echo-e "\ 033 [31 m red word \ 033 [0m" echo-e "\ 033 [34 m yellow word \ 033 [0m" echo-e "\ 033 [41; 33 m red base yellow word \ 033 [0 m "echo-e" \ 033 [41; 37 m red bottom White word \ 033 [0 m "color: 30--37 echo-e "\ 033 [30 m black word \ 033 [0m" echo-e "\ 033 [31 m red word \ 033 [0m" echo-e "\ 033 [32 m green word \ 033 [0 m "echo-e" \ 033 [33 m yellow word \ 033 [0 m "echo-e" \ 033 [34 m blue word \ 033 [0 m "echo-e" \ 033 [35 m purple words \ 033 [0m "echo-e" \ 033 [36 m Sky Blue words \ 033 [0m "echo-e" \ 033 [37 m White words \ 033 [0 m"
Color range: 40--47 echo-e "\ 033 [40; 37 m black white text \ 033 [0m" echo-e "\ 033 [41; 37 m white text \ 033 [0 m "echo-e" \ 033 [42; 37 m white text \ 033 [0 m "echo-e" \ 033 [43; 37 m yellow-white characters \ 033 [0 m "echo-e" \ 033 [44; 37 m blue-white words \ 033 [0 m "echo-e" \ 033 [45; 37 m white text \ 033 [0 m "echo-e" \ 033 [46; 37 m white text \ 033 [0 m "echo-e" \ 033 [47; 30 m White Black \ 033 [0m "last surface control option description www.2cto.com \ 33 [0 m close all properties \ 33 [1 m set high brightness \ 33 [4 m underline \ 33 [5 m flashing \ 33 [7 m reverse display \ 33 [8 m blanking
\ 33 [30 m-\ 33 [37 m set foreground color \ 33 [40 m-\ 33 [47 m set background color \ 33 [nA cursor move n rows up \ 33 [nB cursor move n rows down \ 33 [nC cursor shifted n rows right \ 33 [nD cursor shifted n rows left \ 33 [y; xH set the cursor position \ 33 [2J clear screen \ 33 [K clear content from the cursor to the end of the line \ 33 [s save the cursor position \ 33 [u restore the cursor position \ 33 [? 25l hide the cursor \ 33 [? 25 h show cursor author gaoming655
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service