The shell, as a scripting language, is a skill that every Linux administrator must master, sometimes adding some background color to the output in the shell, making the script a little more aesthetically pleasing, and using echo to output a string, by default, the string echo displays is white.
650) this.width=650; "title=" QQ picture 20150402132920.png "Src=" http://s3.51cto.com/wyfs02/M00/5C/36/ Wkiol1uc1jhbe6ceaaanlujjvlw274.jpg "alt=" Wkiol1uc1jhbe6ceaaanlujjvlw274.jpg "/>
We can add some color
650) this.width=650; "title=" QQ picture 20150402133117.png "Src=" http://s3.51cto.com/wyfs02/M01/5C/36/ Wkiol1uc1qtx0jnoaaakigumyd4798.jpg "alt=" Wkiol1uc1qtx0jnoaaakigumyd4798.jpg "/>
So how does it come true? The original script code is given below
650) this.width=650; "title=" QQ picture 20150402133236.png "Src=" http://s3.51cto.com/wyfs02/M01/5C/36/ Wkiol1uc1vkbknfzaabciue0ihe828.jpg "alt=" Wkiol1uc1vkbknfzaabciue0ihe828.jpg "/>
Probably see so many numbers a little bit ignorant, give specific format just fine
"\033[front character color; background color xxxx\033[0m" no later.
The last [0m represents the restoration of the original color, if not added, it would be the effect
650) this.width=650; "title=" QQ picture 20150402133526.png "Src=" http://s3.51cto.com/wyfs02/M02/5C/3B/ Wkiom1uc1ltdmqjraabkewc2sac514.jpg "alt=" Wkiom1uc1ltdmqjraabkewc2sac514.jpg "/>
The command prompt and commands are red when you see them.
The specific color there are many people need to remember the color of the code, such as \033[32 on behalf of Green, we search down the test bar.
This article is from the "Sir Teng" blog, please be sure to keep this source http://naturelong1989.blog.51cto.com/627491/1627651
Shell Tips--color output